From 0106d3d69f0d493b8ce82e5a289794d0fbb2b47c Mon Sep 17 00:00:00 2001 From: Aevann Date: Thu, 22 Jun 2023 19:19:05 +0300 Subject: [PATCH] same as last commit --- files/routes/asset_submissions.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index d1d3cc768..745da5e78 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -159,14 +159,11 @@ def approve_emoji(v, name): badge_grant(badge_id=16, user=author) else: badge_grant(badge_id=17, user=author) - - if emoji.name.startswith("marseycapy"): - all_by_author = all_by_author.filter(Emoji.name.like("marseycapy%")).count() - if all_by_author >= 10: - badge_grant(badge_id=115, user=author) - else: - badge_grant(badge_id=114, user=author) - + elif emoji.kind == "Capy": + all_by_author = g.db.query(Emoji).filter_by(kind="Capy", author_id=author.id).count() + if all_by_author >= 10: + badge_grant(badge_id=115, user=author) + badge_grant(badge_id=114, user=author) elif emoji.kind == "Wolf": all_by_author = g.db.query(Emoji).filter_by(kind="Wolf", author_id=author.id).count() if all_by_author >= 10: