Compare commits
No commits in common. "76c8df9e03bf89bcfe7b5addfc92431892215e4d" and "c7159cf3b4c64a5f197d7116e4f6d844619bf858" have entirely different histories.
76c8df9e03
...
c7159cf3b4
10
ext.py
10
ext.py
|
@ -194,14 +194,10 @@ class Order:
|
||||||
print("POSITION ID IS", self.position_id)
|
print("POSITION ID IS", self.position_id)
|
||||||
|
|
||||||
for i, ans in enumerate(self.answers):
|
for i, ans in enumerate(self.answers):
|
||||||
if TYPE_OF_QUESTIONS[ans['question']] == QUESTION_TYPES["multiple_choice_from_list"]: # if multiple choice
|
|
||||||
identifier = ans['question_identifier']
|
|
||||||
if self.ans(identifier) == "": #if empty answer
|
|
||||||
await self.edit_answer(identifier, None)
|
|
||||||
# Fix for karaoke fields
|
# Fix for karaoke fields
|
||||||
#if ans['question'] == 40:
|
if ans['question'] == 40:
|
||||||
# del self.answers[i]['options']
|
del self.answers[i]['options']
|
||||||
# del self.answers[i]['option_identifiers']
|
del self.answers[i]['option_identifiers']
|
||||||
|
|
||||||
res = await client.patch(join(base_url_event, f'orderpositions/{self.position_id}/'), headers=headers, json={'answers': self.answers})
|
res = await client.patch(join(base_url_event, f'orderpositions/{self.position_id}/'), headers=headers, json={'answers': self.answers})
|
||||||
|
|
||||||
|
|
|
@ -68,6 +68,8 @@ async def upload_propic(request, order: Order):
|
||||||
|
|
||||||
with open(f"res/propic/{fn}_{order.code}_original.jpg", "wb") as f:
|
with open(f"res/propic/{fn}_{order.code}_original.jpg", "wb") as f:
|
||||||
f.write(body[0].body)
|
f.write(body[0].body)
|
||||||
|
f.flush()
|
||||||
|
f.close()
|
||||||
|
|
||||||
aspect_ratio = width/height
|
aspect_ratio = width/height
|
||||||
if aspect_ratio > 1:
|
if aspect_ratio > 1:
|
||||||
|
@ -86,6 +88,8 @@ async def upload_propic(request, order: Order):
|
||||||
imgBytes = imgBytes.getvalue()
|
imgBytes = imgBytes.getvalue()
|
||||||
with open(f"res/propic/{fn}_{order.code}_{h}.jpg", "wb") as f:
|
with open(f"res/propic/{fn}_{order.code}_{h}.jpg", "wb") as f:
|
||||||
f.write(imgBytes)
|
f.write(imgBytes)
|
||||||
|
f.flush()
|
||||||
|
f.close()
|
||||||
|
|
||||||
await order.edit_answer_fileUpload(f'{fn}_file', f'{fn}_file_{order.code}_{h}.jpg', 'image/jpeg', imgBytes)
|
await order.edit_answer_fileUpload(f'{fn}_file', f'{fn}_file_{order.code}_{h}.jpg', 'image/jpeg', imgBytes)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|
Loading…
Reference in New Issue