Remove special cases for unused awards.
Removes the following awards / fields on User: - flairlock - progressivestack - bird - longpost (pizzashill) - marseyawarded - rehab - deflector - mute - unmutable - eye (All-Seeing Eye) - alt (Alt-Seeing Eye) Primarily motivated by starting to remove some un-Mottelike cruft from core commenting/posting routes. Cleared out other inapplicable awards while in the process.
This commit is contained in:
parent
9de6f20dea
commit
3f360bb457
18 changed files with 77 additions and 582 deletions
|
@ -210,7 +210,6 @@ def front_all(v, sub=None, subdomain=None):
|
|||
if v:
|
||||
if v.hidevotedon: posts = [x for x in posts if not hasattr(x, 'voted') or not x.voted]
|
||||
|
||||
|
||||
if v.patron_utc and v.patron_utc < time.time():
|
||||
v.patron = 0
|
||||
v.patron_utc = 0
|
||||
|
@ -218,7 +217,6 @@ def front_all(v, sub=None, subdomain=None):
|
|||
if v.discord_id: remove_role(v, "1")
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
if v.unban_utc and v.unban_utc < time.time():
|
||||
v.is_banned = 0
|
||||
v.unban_utc = 0
|
||||
|
@ -227,60 +225,6 @@ def front_all(v, sub=None, subdomain=None):
|
|||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
if v.flairchanged and v.flairchanged < time.time():
|
||||
v.flairchanged = None
|
||||
send_repeatable_notification(v.id, "Your flair lock has expired. You can now change your flair!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(96)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.marseyawarded and v.marseyawarded < time.time():
|
||||
v.marseyawarded = None
|
||||
send_repeatable_notification(v.id, "Your marsey award has expired!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(98)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.longpost and v.longpost < time.time():
|
||||
v.longpost = None
|
||||
send_repeatable_notification(v.id, "Your pizzashill award has expired!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(97)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.bird and v.bird < time.time():
|
||||
v.bird = None
|
||||
send_repeatable_notification(v.id, "Your bird site award has expired!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(95)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.progressivestack and v.progressivestack < time.time():
|
||||
v.progressivestack = None
|
||||
send_repeatable_notification(v.id, "Your progressive stack has expired!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(94)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.rehab and v.rehab < time.time():
|
||||
v.rehab = None
|
||||
send_repeatable_notification(v.id, "Your rehab has finished!")
|
||||
g.db.add(v)
|
||||
badge = v.has_badge(109)
|
||||
if badge: g.db.delete(badge)
|
||||
g.db.commit()
|
||||
|
||||
if v.deflector and v.deflector < time.time():
|
||||
v.deflector = None
|
||||
send_repeatable_notification(v.id, "Your deflector has expired!")
|
||||
g.db.add(v)
|
||||
g.db.commit()
|
||||
|
||||
if request.headers.get("Authorization"): return {"data": [x.json for x in posts], "next_exists": next_exists}
|
||||
return render_template("home.html", v=v, listing=posts, next_exists=next_exists, sort=sort, t=t, page=page, ccmode=ccmode, sub=sub, home=True)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue