Now you can upload pics even after the deadline

This commit is contained in:
Ed 2023-05-23 22:15:01 +02:00
parent db97fe0e7e
commit 86ceed6a93
2 changed files with 38 additions and 37 deletions

2
ext.py
View File

@ -75,6 +75,8 @@ class Order:
self.is_fursuiter = True if self.ans('is_fursuiter') != 'No' else False
self.is_allergic = True if self.ans('is_allergic') != 'No' else False
self.propic_locked = self.ans('propic_locked')
self.propic_fursuiter = self.ans('propic_fursuiter')
self.propic = self.ans('propic')
self.carpooling_message = json.loads(self.ans('carpooling_message')) if self.ans('carpooling_message') else {}
self.karaoke_songs = json.loads(self.ans('karaoke_songs')) if self.ans('karaoke_songs') else {}
self.birth_date = self.ans('birth_date')

View File

@ -19,15 +19,14 @@ async def upload_propic(request, order: Order):
if order.propic_locked:
raise exceptions.BadRequest("You have been limited from further editing the propic.")
if time() > PROPIC_DEADLINE:
raise exceptions.BadRequest("You are beyond the file upload deadline. No more changes are allowed.")
if request.form.get('submit') != 'Upload' and time() > PROPIC_DEADLINE:
raise exceptions.BadRequest("The deadline has passed. You cannot modify the badges at this moment.")
if request.form.get('submit') == 'Delete main image':
await order.edit_answer('propic', None)
if request.form.get('submit') == 'Delete fursuit image':
elif request.form.get('submit') == 'Delete fursuit image':
await order.edit_answer('propic_fursuiter', None)
else:
for fn, body in request.files.items():
if fn not in ['propic', 'propic_fursuiter']:
continue