forked from rDrama/rDrama
disallow ppl from using unban awards to undo janny bans
parent
82e9d1fc0c
commit
7ee0488a86
|
@ -275,6 +275,9 @@ def award_thing(v, thing_type, id):
|
||||||
if not author.is_suspended or not author.unban_utc:
|
if not author.is_suspended or not author.unban_utc:
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
|
if not author.ban_reason.startswith('1-Day ban award'):
|
||||||
|
abort(400, "You can only use unban awards to undo the effect of ban awards!")
|
||||||
|
|
||||||
if author.unban_utc - time.time() > 86400:
|
if author.unban_utc - time.time() > 86400:
|
||||||
author.unban_utc -= 86400
|
author.unban_utc -= 86400
|
||||||
send_repeatable_notification(author.id, "Your ban duration has been reduced by 1 day!")
|
send_repeatable_notification(author.id, "Your ban duration has been reduced by 1 day!")
|
||||||
|
|
Loading…
Reference in New Issue