diff --git a/admin.py b/admin.py index df1d7fc..897b588 100644 --- a/admin.py +++ b/admin.py @@ -26,7 +26,7 @@ async def clearCache(request, order:Order): @bp.get('/room/unconfirm/') async def unconfirmRoom(request, code, order:Order): credentialsCheck(request, order) - dOrder = await getOrderByCode_safe(request, code) + dOrder = await getOrderByCode(request, code, throwException=True) if(not dOrder.room_confirmed): raise exceptions.BadRequest("Room is not confirmed!") @@ -41,7 +41,7 @@ async def unconfirmRoom(request, code, order:Order): @bp.get('/room/delete/') async def deleteRoom(request, code, order:Order): credentialsCheck(request, order) - dOrder = await getOrderByCode_safe(request, code) + dOrder = await getOrderByCode(request, code, throwException=True) ppl = getPeopleInRoomByRoomId(request, code) for p in ppl: @@ -61,7 +61,7 @@ async def deleteRoom(request, code, order:Order): @bp.post('/room/rename/') async def renameRoom(request, code, order:Order): credentialsCheck(request, order) - dOrder = await getOrderByCode_safe(request, code) + dOrder = await getOrderByCode(request, code, throwException=True) name = request.form.get('name') if len(name) > 64 or len(name) < 4: diff --git a/propic.py b/propic.py index 43d8758..c900976 100644 --- a/propic.py +++ b/propic.py @@ -18,7 +18,8 @@ async def resetDefaultPropic(request, order: Order, isFursuiter, sendAnswer=True data = f.read() f.close() os.remove(f"res/propic/{order.ans(f'propic{s}')}") # converted file - os.remove(f"res/propic/{order.ans(f'propic{s}').split(".jpg")[0]}_original.jpg") # original file + filenameNoExt = order.ans(f'propic{s}').split(".jpg")[0] + os.remove(f"res/propic/{filenameNoExt}_original.jpg") # original file await order.edit_answer_fileUpload(f'propic{s}_file', f'propic{s}_file_{order.code}_default.png', 'image/png', data) if(sendAnswer): await order.send_answers() diff --git a/res/scripts/roomManager.js b/res/scripts/roomManager.js index 1eebee1..0995ae9 100644 --- a/res/scripts/roomManager.js +++ b/res/scripts/roomManager.js @@ -18,6 +18,7 @@ function confirmAction (intent, sender) { intentEditPanel.style.display = 'block'; intentEdit.setAttribute('required', true) intentFormAction.setAttribute('method', 'POST') + document.getElementById("intentRename").value = sender.parentElement.parentElement.querySelector("span").innerText; break case 'unconfirm': break diff --git a/tpl/blocks/room_extra.html b/tpl/blocks/room_extra.html index bfa60fe..9266764 100644 --- a/tpl/blocks/room_extra.html +++ b/tpl/blocks/room_extra.html @@ -54,7 +54,7 @@
- +
diff --git a/tpl/fursuitcount.html b/tpl/fursuitcount.html index 87913d6..08ea5d4 100644 --- a/tpl/fursuitcount.html +++ b/tpl/fursuitcount.html @@ -15,7 +15,7 @@
{% endif %}
- {% with order=person, imgSrc='/res/propic/' + (person.ans('propic_fursuiter') or 'default.png'), effects = false, flag = true %} + {% with order=person, imgSrc='/res/propic/' + (person.ans('propic_fursuiter') or 'default.png'), effects = true, flag = true %} {% include 'blocks/propic.html' %} {% endwith %}
{{person.ans('fursona_name')}}
diff --git a/utils.py b/utils.py index ae44b1d..211a994 100644 --- a/utils.py +++ b/utils.py @@ -125,10 +125,12 @@ def sizeof_fmt(num, suffix="B"): num /= 1000.0 return f"{num:.1f}Yi{suffix}" -async def getOrderByCode_safe(request, code): +async def getOrderByCode(request, code, throwException=False): res = await request.app.ctx.om.get_order(code=code) + if not throwException: + return res if res is None: - raise exceptions.BadRequest(f"[getOrderByCode_safe] Code {code} not found!") + raise exceptions.BadRequest(f"[getOrderByCode] Code {code} not found!") return res def getPeopleInRoomByRoomId(request, roomId):