mirror of
https://gitlab.science.ru.nl/technicie/MarietjeDjango.git
synced 2025-12-09 18:52:23 +01:00
Fix upload bug (astimezone)
This commit is contained in:
@ -323,13 +323,12 @@ def upload_stats(user):
|
||||
@transaction.atomic
|
||||
def _request_weight(ps):
|
||||
def _is_regular_queue(ps):
|
||||
ps = ps.astimezone()
|
||||
if not ps.played_at:
|
||||
# Request is from the old times, assume good
|
||||
return True
|
||||
if not 0 <= ps.played_at.weekday() <= 4:
|
||||
if not 0 <= ps.played_at.astimezone().weekday() <= 4:
|
||||
return False # Queued in the weekend
|
||||
if not 7 <= ps.played_at.hour <= 22:
|
||||
if not 7 <= ps.played_at.astimezone().hour <= 22:
|
||||
# Because of timezone shit, I allow for an extra hour of leeway
|
||||
return False # Queued outside of regular opening hours
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user