fix prev commit

master
justcool393 2022-11-06 06:08:39 -06:00
parent 83fe77c039
commit c10b3e4262
1 changed files with 4 additions and 3 deletions

View File

@ -29,6 +29,7 @@ def settings_personal(v):
@app.delete('/settings/background') @app.delete('/settings/background')
@limiter.limit("1/second;30/minute;200/hour;1000/day") @limiter.limit("1/second;30/minute;200/hour;1000/day")
@limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}') @limiter.limit("1/second;30/minute;200/hour;1000/day", key_func=lambda:f'{SITE}-{session.get("lo_user")}')
@auth_required
def remove_background(v): def remove_background(v):
if v.background: if v.background:
v.background = None v.background = None
@ -57,7 +58,7 @@ def settings_profile_post(v):
if current_value and request_flag and request.values.get("permanent", '') == 'true' and request.values.get("username") == v.username: if current_value and request_flag and request.values.get("permanent", '') == 'true' and request.values.get("username") == v.username:
if v.client: abort(403, "Cannot set filters permanently from the API") if v.client: abort(403, "Cannot set filters permanently from the API")
request_flag = int(time.time()) request_flag = int(time.time())
setattr(v, column_name, request_flag) # setattr(v, column_name, request_flag)
if badge_id: badge_grant(v, badge_id) if badge_id: badge_grant(v, badge_id)
return render_template("settings_personal.html", v=v, msg=f"Set the {friendly_name} filter permanently!") return render_template("settings_personal.html", v=v, msg=f"Set the {friendly_name} filter permanently!")
elif current_value != request_flag: elif current_value != request_flag:
@ -77,14 +78,14 @@ def settings_profile_post(v):
updated = True updated = True
session['poor'] = v.poor session['poor'] = v.poor
slur_filter_updated = updated or update_flag_with_permanence("slurfilter", "slurfilter", "slur filter", 143) slur_filter_updated = updated or update_flag_with_permanence("slurreplacer", "slurreplacer", "slur replacer", 143)
if isinstance(slur_filter_updated, bool): if isinstance(slur_filter_updated, bool):
updated = slur_filter_updated updated = slur_filter_updated
else: else:
g.db.add(v) g.db.add(v)
return slur_filter_updated return slur_filter_updated
profanity_filter_updated = updated or update_flag_with_permanence("profanityfilter", "profanityfilter", "profanity filter", 142) profanity_filter_updated = updated or update_flag_with_permanence("profanityreplacer", "profanityreplacer", "profanity replacer", 142)
if isinstance(profanity_filter_updated, bool): if isinstance(profanity_filter_updated, bool):
updated = profanity_filter_updated updated = profanity_filter_updated
else: else: