forked from MarseyWorld/MarseyWorld
fix wrong emoji count
parent
9a7bf87dc9
commit
72075e4db3
|
@ -151,32 +151,31 @@ def approve_emoji(v, name):
|
|||
author = get_account(emoji.author_id)
|
||||
|
||||
if emoji.kind == "Marsey":
|
||||
all_by_author = g.db.query(Emoji).filter_by(kind="Marsey", author_id=author.id)
|
||||
count = all_by_author.count()
|
||||
all_by_author = g.db.query(Emoji).filter_by(kind="Marsey", author_id=author.id).count()
|
||||
|
||||
if count >= 99:
|
||||
if count >= 100:
|
||||
badge_grant(badge_id=143, user=author)
|
||||
elif count >= 9:
|
||||
elif count >= 10:
|
||||
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 >= 9:
|
||||
if all_by_author >= 10:
|
||||
badge_grant(badge_id=115, user=author)
|
||||
else:
|
||||
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 >= 9:
|
||||
if all_by_author >= 10:
|
||||
badge_grant(badge_id=111, user=author)
|
||||
else:
|
||||
badge_grant(badge_id=110, user=author)
|
||||
elif emoji.kind == "Platy":
|
||||
all_by_author = g.db.query(Emoji).filter_by(kind="Platy", author_id=author.id).count()
|
||||
if all_by_author >= 9:
|
||||
if all_by_author >= 10:
|
||||
badge_grant(badge_id=113, user=author)
|
||||
else:
|
||||
badge_grant(badge_id=112, user=author)
|
||||
|
|
Loading…
Reference in New Issue