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)
|
author = get_account(emoji.author_id)
|
||||||
|
|
||||||
if emoji.kind == "Marsey":
|
if emoji.kind == "Marsey":
|
||||||
all_by_author = g.db.query(Emoji).filter_by(kind="Marsey", author_id=author.id)
|
all_by_author = g.db.query(Emoji).filter_by(kind="Marsey", author_id=author.id).count()
|
||||||
count = all_by_author.count()
|
|
||||||
|
|
||||||
if count >= 99:
|
if count >= 100:
|
||||||
badge_grant(badge_id=143, user=author)
|
badge_grant(badge_id=143, user=author)
|
||||||
elif count >= 9:
|
elif count >= 10:
|
||||||
badge_grant(badge_id=16, user=author)
|
badge_grant(badge_id=16, user=author)
|
||||||
else:
|
else:
|
||||||
badge_grant(badge_id=17, user=author)
|
badge_grant(badge_id=17, user=author)
|
||||||
|
|
||||||
if emoji.name.startswith("marseycapy"):
|
if emoji.name.startswith("marseycapy"):
|
||||||
all_by_author = all_by_author.filter(Emoji.name.like("marseycapy%")).count()
|
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)
|
badge_grant(badge_id=115, user=author)
|
||||||
else:
|
else:
|
||||||
badge_grant(badge_id=114, user=author)
|
badge_grant(badge_id=114, user=author)
|
||||||
|
|
||||||
elif emoji.kind == "Wolf":
|
elif emoji.kind == "Wolf":
|
||||||
all_by_author = g.db.query(Emoji).filter_by(kind="Wolf", author_id=author.id).count()
|
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)
|
badge_grant(badge_id=111, user=author)
|
||||||
else:
|
else:
|
||||||
badge_grant(badge_id=110, user=author)
|
badge_grant(badge_id=110, user=author)
|
||||||
elif emoji.kind == "Platy":
|
elif emoji.kind == "Platy":
|
||||||
all_by_author = g.db.query(Emoji).filter_by(kind="Platy", author_id=author.id).count()
|
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)
|
badge_grant(badge_id=113, user=author)
|
||||||
else:
|
else:
|
||||||
badge_grant(badge_id=112, user=author)
|
badge_grant(badge_id=112, user=author)
|
||||||
|
|
Loading…
Reference in New Issue