bring back the badge editor

This commit is contained in:
2026-06-05 07:19:53 +03:00
parent c7ba23ad22
commit 6fab93ebeb
10 changed files with 426 additions and 12 deletions

View File

@@ -648,6 +648,12 @@ class BadgeUploads(Model):
class Badges(Model):
table = 'badges'
@classmethod
def get_for_user(cls, user_id):
q = 'SELECT * FROM badges WHERE user_id = ? ORDER BY sort_order ASC'
res = db.query(q, user_id)
return [cls.from_data(row) for row in res]
def get_image_url(self):
bu = BadgeUploads.find({'id': int(self.upload)})
return bu.file_path