forked from MarseyWorld/MarseyWorld
use site specific patron name
parent
7b3361cfb7
commit
c67406b84b
|
@ -45,7 +45,7 @@ def process_audio(file):
|
||||||
size = os.stat(name).st_size
|
size = os.stat(name).st_size
|
||||||
if size > MAX_IMAGE_AUDIO_SIZE_MB_PATRON * 1024 * 1024 or not g.v.patron and size > MAX_IMAGE_AUDIO_SIZE_MB * 1024 * 1024:
|
if size > MAX_IMAGE_AUDIO_SIZE_MB_PATRON * 1024 * 1024 or not g.v.patron and size > MAX_IMAGE_AUDIO_SIZE_MB * 1024 * 1024:
|
||||||
os.remove(name)
|
os.remove(name)
|
||||||
abort(413, f"Max image/audio size is {MAX_IMAGE_AUDIO_SIZE_MB} MB ({MAX_IMAGE_AUDIO_SIZE_MB_PATRON} MB for paypigs)")
|
abort(413, f"Max image/audio size is {MAX_IMAGE_AUDIO_SIZE_MB} MB ({MAX_IMAGE_AUDIO_SIZE_MB_PATRON} MB for {patron.lower()}s)")
|
||||||
|
|
||||||
media = g.db.query(Media).filter_by(filename=name, kind='audio').one_or_none()
|
media = g.db.query(Media).filter_by(filename=name, kind='audio').one_or_none()
|
||||||
if media: g.db.delete(media)
|
if media: g.db.delete(media)
|
||||||
|
|
|
@ -313,7 +313,7 @@ def award_thing(v, thing_type, id):
|
||||||
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(400, "This user is already a paypig!")
|
if author.patron: abort(409, f"This user 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
|
||||||
|
|
Loading…
Reference in New Issue