master
Aevann1 2021-10-16 16:44:42 +02:00
parent e0a0518164
commit 720ea0a6e9
2 changed files with 14 additions and 17 deletions

View File

@ -147,22 +147,6 @@ def settings_profile_post(v):
v=v,
msg="Your bio has been updated.")
if request.values.get("filters"):
filters=request.values.get("filters")[:1000].strip()
if filters==v.custom_filter_list:
return render_template("settings_profile.html",
v=v,
error="You didn't change anything")
v.custom_filter_list=filters
g.db.add(v)
g.db.commit()
return render_template("settings_profile.html",
v=v,
msg="Your custom filters have been updated.")
frontsize = request.values.get("frontsize")
@ -243,6 +227,19 @@ def settings_profile_post(v):
else:
return {"error": "You didn't change anything."}, 400
@app.post("/settings/filters")
@auth_required
def filters(v):
filters=request.values.get("filters")[:1000].strip()
if filters == v.custom_filter_list: return render_template("settings_content.html", v=v, error="You didn't change anything")
v.custom_filter_list=filters
g.db.add(v)
g.db.commit()
return render_template("settings_content.html", v=v, msg="Your custom filters have been updated.")
@app.post("/changelogsub")
@auth_required
@validate_formkey

View File

@ -286,7 +286,7 @@
</div>
<div class="body w-lg-100">
<form id="custom-filter" action="/settings/profile" method="post">
<form id="custom-filter" action="/settings/filters" method="post">
<input type="hidden" name="formkey" value="{{v.formkey}}">
<small>Hides matching posts from the frontpage and collapses matching comments.</small>
<div class="input-group mb-2">