"This user" -> "@username"

master
Aevann1 2022-11-12 12:08:43 +02:00
parent 1b162fb049
commit a9188f5dac
1 changed files with 7 additions and 7 deletions

View File

@ -159,7 +159,7 @@ def award_thing(v, thing_type, id):
if author.shadowbanned: abort(404) if author.shadowbanned: abort(404)
if SITE == 'rdrama.net' and author.id in (PIZZASHILL_ID, CARP_ID): if SITE == 'rdrama.net' and author.id in (PIZZASHILL_ID, CARP_ID):
abort(403, "This user is immune to awards.") abort(403, f"@{author.username} is immune to awards.")
if kind == "benefactor" and author.id == v.id: if kind == "benefactor" and author.id == v.id:
abort(400, "You can't use this award on yourself.") abort(400, "You can't use this award on yourself.")
@ -257,10 +257,10 @@ def award_thing(v, thing_type, id):
g.db.add(thing) g.db.add(thing)
elif kind == "agendaposter": elif kind == "agendaposter":
if author.marseyawarded: if author.marseyawarded:
abort(409, "This user is under the effect of a conflicting award: Marsey award.") abort(409, f"@{author.username} is under the effect of a conflicting award: Marsey award.")
if author.agendaposter == 1: if author.agendaposter == 1:
abort(409, "This user is perma-chudded.") abort(409, f"@{author.username} is perma-chudded.")
if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400 if author.agendaposter and time.time() < author.agendaposter: author.agendaposter += 86400
else: author.agendaposter = int(time.time()) + 86400 else: author.agendaposter = int(time.time()) + 86400
@ -288,13 +288,13 @@ def award_thing(v, thing_type, id):
badge_grant(user=author, badge_id=98) badge_grant(user=author, badge_id=98)
elif kind == "pizzashill": elif kind == "pizzashill":
if author.bird: if author.bird:
abort(409, "This user is under the effect of a conflicting award: Bird Site award.") abort(409, f"@{author.username} is under the effect of a conflicting award: Bird Site award.")
if author.longpost: author.longpost += 86400 if author.longpost: author.longpost += 86400
else: author.longpost = int(time.time()) + 86400 else: author.longpost = int(time.time()) + 86400
badge_grant(user=author, badge_id=97) badge_grant(user=author, badge_id=97)
elif kind == "bird": elif kind == "bird":
if author.longpost: if author.longpost:
abort(409, "This user is under the effect of a conflicting award: Pizzashill award.") abort(409, f"@{author.username} is under the effect of a conflicting award: Pizzashill award.")
if author.bird: author.bird += 86400 if author.bird: author.bird += 86400
else: author.bird = int(time.time()) + 86400 else: author.bird = int(time.time()) + 86400
badge_grant(user=author, badge_id=95) badge_grant(user=author, badge_id=95)
@ -313,13 +313,13 @@ def award_thing(v, thing_type, id):
if not FEATURES['PINS']: if not FEATURES['PINS']:
abort(403) abort(403)
if author.id in BOOSTED_USERS: abort(409, f"This user is already permanently progressive-stacked!") if author.id in BOOSTED_USERS: abort(409, f"@{author.username} is already permanently progressive-stacked!")
if author.progressivestack: author.progressivestack += 21600 if author.progressivestack: author.progressivestack += 21600
else: author.progressivestack = int(time.time()) + 21600 else: author.progressivestack = int(time.time()) + 21600
badge_grant(user=author, badge_id=94) badge_grant(user=author, badge_id=94)
elif kind == "benefactor": elif kind == "benefactor":
if author.patron: abort(409, f"This user is already a {patron.lower()}!") if author.patron: abort(409, f"@{author.username} is already a {patron.lower()}!")
author.patron = 1 author.patron = 1
if author.patron_utc: author.patron_utc += 2629746 if author.patron_utc: author.patron_utc += 2629746
else: author.patron_utc = int(time.time()) + 2629746 else: author.patron_utc = int(time.time()) + 2629746