From 7e791b33e57d8065c2b059625230d356f1f3b29a Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Fri, 22 Oct 2021 22:02:04 +0800 Subject: Exposed database operations take argument "date" Namely, Database.take_away and Database.give_back "date" is an instance of datetime.datatime --- jimbrella/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jimbrella/database.py b/jimbrella/database.py index 63cba49..ffe5d2f 100644 --- a/jimbrella/database.py +++ b/jimbrella/database.py @@ -197,7 +197,7 @@ class Database: ] def take_away( - self, serial, tenant_name, tenant_id, tenant_phone="", tenant_email="" + self, serial, date, tenant_name, tenant_id, tenant_phone="", tenant_email="" ) -> None: """When a user has borrowed an umbrella.""" umb = self._find_by_serial(serial) @@ -210,10 +210,10 @@ class Database: umb["tenant_id"] = tenant_id umb["tenant_phone"] = tenant_phone umb["tenant_email"] = tenant_email - umb["lent_at"] = datetime.now() + umb["lent_at"] = date self._update(umb) - def give_back(self, serial) -> None: + def give_back(self, serial, date) -> None: """When a user has returned an umbrella.""" umb = self._find_by_serial(serial) if umb is None: -- cgit v1.2.3