stranck-dev #5

Merged
drew merged 4 commits from stranck-dev into drew-dev 2024-01-07 20:31:00 +00:00
1 changed files with 2 additions and 2 deletions
Showing only changes of commit 866ac5b9d5 - Show all commits

View File

@ -7,7 +7,7 @@ bp = Blueprint("stats", url_prefix="/manage")
@bp.route("/sponsorcount") @bp.route("/sponsorcount")
async def sponsor_count(request, order: Order): async def sponsor_count(request, order: Order):
await request.app.ctx.om.updateCache() await request.app.ctx.om.updateCache()
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']} orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: x[1].ans('fursona_name')) if value.status not in ['c', 'e']}
tpl = request.app.ctx.tpl.get_template('sponsorcount.html') tpl = request.app.ctx.tpl.get_template('sponsorcount.html')
return html(tpl.render(orders=orders, order=order)) return html(tpl.render(orders=orders, order=order))
@ -23,7 +23,7 @@ async def nose_count(request, order: Order):
@bp.route("/fursuitcount") @bp.route("/fursuitcount")
async def fursuit_count(request, order: Order): async def fursuit_count(request, order: Order):
await request.app.ctx.om.updateCache() await request.app.ctx.om.updateCache()
orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: len(x[1].room_members), reverse=True) if value.status not in ['c', 'e']} orders = {key:value for key,value in sorted(request.app.ctx.om.cache.items(), key=lambda x: x[1].ans('fursona_name')) if value.status not in ['c', 'e']}
tpl = request.app.ctx.tpl.get_template('fursuitcount.html') tpl = request.app.ctx.tpl.get_template('fursuitcount.html')
return html(tpl.render(orders=orders, order=order)) return html(tpl.render(orders=orders, order=order))