remotes/1693045480750635534/spooky-22
Aevann1 2021-11-15 02:43:07 +02:00
parent 9b93e0db79
commit 387bcc2233
2 changed files with 3 additions and 3 deletions

View File

@ -28,8 +28,8 @@ def votes2(v, id):
voters=[x[0] for x in votes]
counts=[x[1] for x in votes]
users = g.db.query(User.id, User.username).filter(User.id.in_(voters)).all()
users = [x[1] for x in sorted(users, key=lambda x: voters.index(x[0]))]
users = g.db.query(User).filter(User.id.in_(voters)).all()
users = sorted(users, key=lambda x: voters.index(x.id))
users2 = []
for idx, user in enumerate(users): users2.append((user, counts[idx]))

View File

@ -16,7 +16,7 @@
{% for user in users %}
<tr>
<td style="font-weight: bold">{{loop.index}}</td>
<td style="font-weight: bold">{{user[0]}}</td>
<td><a style="color:#{{user[0].namecolor}}; font-weight:bold;" href="/@{{user[0].username}}"><img loading="lazy" src="/uid/{{user[0].id}}/pic" class="pp20"><span {% if user[0].patron %}class="patron" style="background-color:#{{user[0].namecolor}};"{% endif %}>{{user[0].username}}</span></a></td>
<td style="font-weight: bold">{{user[1]}}</td>
</tr>
{% endfor %}