add error for signatures for non-paypigs

master
Aevann 2023-07-02 22:57:08 +03:00
parent dd37775c6b
commit f4af0779fd
2 changed files with 6 additions and 3 deletions

View File

@ -60,7 +60,7 @@ def upload_custom_background(v):
if g.is_tor: abort(403, "Image uploads are not allowed through TOR!")
if not v.patron:
abort(403, f"This feature is only available to {patron}s!")
abort(403, f"Custom site backgrounds are only available to {patron}s!")
file = request.files["file"]
@ -232,7 +232,10 @@ def settings_personal_post(v):
g.db.add(v)
return render_template("settings/personal.html", v=v, msg="Your enemies list has been updated!")
elif not updated and v.patron and request.values.get("sig"):
elif not updated and request.values.get("sig"):
if not v.patron:
abort(403, f"Signatures are only available to {patron}s!")
sig = request.values.get("sig")[:200].replace('\n','').replace('\r','')
sig_html = sanitize(sig, blackjack="signature")
if len(sig_html) > 1000:

View File

@ -213,7 +213,7 @@
{{common.text_area_section('profile-bio', '/settings/personal', 'bio', 'Bio', v.bio, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Tell the community a bit about yourself.', true, true, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, FEATURES['USERS_PROFILE_BODYTEXT'])}}
{{common.text_area_section('profile-friends', '/settings/personal', 'friends', 'Friends', v.friends, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your friends on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}}
{{common.text_area_section('profile-enemies', '/settings/personal', 'enemies', 'Enemies', v.enemies, 'Limit of ' ~ BIO_FRIENDS_ENEMIES_LENGTH_LIMIT ~ ' characters', 'Enter your enemies on the site...', false, false, BIO_FRIENDS_ENEMIES_LENGTH_LIMIT, true)}}
{{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200, v.patron or v.sig)}}
{{common.text_area_section('profile-signature', '/settings/personal', 'sig', 'Signature', v.sig, 'Limit of 200 characters', 'Enter a signature...', true, false, 200, true)}}
{# toggle_section(title, id, name, flag, below_text, disabled) #}
{{common.toggle_section('Private Mode', 'privateswitch', 'private', v.is_private, 'This will hide your profile page from others.', false)}}
{{common.toggle_section('Spider', 'spiderswitch', 'spider', v.spider, 'Have a spider friend accompany you during your journey on the site.', v.spider > 1)}}