Improved room management (now room guests have an additional item too)
This commit is contained in:
parent
48c8e5df77
commit
9f92c3806b
3
app.py
3
app.py
|
@ -16,8 +16,9 @@ app.ext.add_dependency(Order, get_order)
|
|||
app.ext.add_dependency(Quotas, get_quotas)
|
||||
|
||||
from room import bp as room_bp
|
||||
from propic import bp as propic_bp
|
||||
|
||||
app.blueprint([room_bp,])
|
||||
app.blueprint([room_bp,propic_bp])
|
||||
|
||||
@app.exception(exceptions.SanicException)
|
||||
async def clear_session(request, exception):
|
||||
|
|
10
room.py
10
room.py
|
@ -265,6 +265,16 @@ async def confirm_room(request, order: Order, quotas: Quotas):
|
|||
if res.status_code != 201:
|
||||
raise exceptions.BadRequest("Something has gone wrong! Please contact support immediately")
|
||||
|
||||
for rm in room_members:
|
||||
if rm.code == order.code: continue
|
||||
thing = {
|
||||
'order': rm.code,
|
||||
'addon_to': rm.position_positionid,
|
||||
'item': 42,
|
||||
'variation': ([None, 21, 22, 23, 24, 25])[len(room_members)]
|
||||
}
|
||||
res = await client.post(join(base_url, "orderpositions/"), headers=headers, json=thing)
|
||||
|
||||
for rm in room_members:
|
||||
await rm.send_answers()
|
||||
|
||||
|
|
Loading…
Reference in New Issue