diff options
author | 2018-07-31 13:25:34 +0000 | |
---|---|---|
committer | 2018-07-31 13:25:34 +0000 | |
commit | a851430e1bc73af8253459d3a7872f50ece4409c (patch) | |
tree | f31b04c9b3dedca2e887282219250a46a334b87a /pysite | |
parent | Merge branch 'enhancement/delete-otname-route' into 'master' (diff) | |
parent | Fix expiry checking when unhophipifying. (diff) |
Merge branch 'bugfix/fix-expired-record-unhiphopification-message' into 'master'
Fix expiry checking when unhophipifying.
Closes bot#29
See merge request python-discord/projects/site!29
Diffstat (limited to 'pysite')
-rw-r--r-- | pysite/views/api/bot/hiphopify.py | 5 |
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.") |