summaryrefslogtreecommitdiff
path: root/jimbrella
diff options
context:
space:
mode:
authorFrederick Yin <fkfd@fkfd.me>2021-10-22 22:02:04 +0800
committerFrederick Yin <fkfd@fkfd.me>2021-10-22 22:02:04 +0800
commit7e791b33e57d8065c2b059625230d356f1f3b29a (patch)
tree0bc0fd463f2b0005bc1df2409e6cf60f25cb5f33 /jimbrella
parenta3d400705e53b131997dc5e9c6ac10f2b5502761 (diff)
Exposed database operations take argument "date"
Namely, Database.take_away and Database.give_back "date" is an instance of datetime.datatime
Diffstat (limited to 'jimbrella')
-rw-r--r--jimbrella/database.py6
1 files 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: