aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2018-07-28 12:45:18 +0200
committerGravatar Johannes Christ <[email protected]>2018-07-28 12:47:35 +0200
commit8cd85d6d2c87f88946e4e716f22e1e86a41224cc (patch)
tree00100faa38e41c347a75c823b61be6e07a3087d7
parentFix unit test (diff)
Fix expiry checking when unhophipifying.
-rw-r--r--pysite/views/api/bot/hiphopify.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/pysite/views/api/bot/hiphopify.py b/pysite/views/api/bot/hiphopify.py
index 3a47b64e..ce4dfa4a 100644
--- a/pysite/views/api/bot/hiphopify.py
+++ b/pysite/views/api/bot/hiphopify.py
@@ -1,4 +1,3 @@
-import datetime
import logging
from flask import jsonify
@@ -147,8 +146,8 @@ class HiphopifyView(APIView, DBMixin):
sentence_expired = None
log.trace(f"Checking if the user ({user_id}) is currently in hiphop-prison.")
- if prisoner_data and prisoner_data.get("end_datetime"):
- sentence_expired = datetime.datetime.now() > prisoner_data.get("end_datetime")
+ if prisoner_data and prisoner_data.get("end_timestamp"):
+ sentence_expired = is_expired(prisoner_data['end_timestamp'])
if prisoner_data and not sentence_expired:
log.debug("User is currently in hiphop-prison. Deleting the record and releasing the prisoner.")