fdsfsd
This commit is contained in:
parent
f5467bd080
commit
6be420aa3b
2 changed files with 14 additions and 17 deletions
|
@ -147,22 +147,6 @@ def settings_profile_post(v):
|
||||||
v=v,
|
v=v,
|
||||||
msg="Your bio has been updated.")
|
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")
|
frontsize = request.values.get("frontsize")
|
||||||
|
@ -243,6 +227,19 @@ def settings_profile_post(v):
|
||||||
else:
|
else:
|
||||||
return {"error": "You didn't change anything."}, 400
|
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")
|
@app.post("/changelogsub")
|
||||||
@auth_required
|
@auth_required
|
||||||
@validate_formkey
|
@validate_formkey
|
||||||
|
|
|
@ -286,7 +286,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="body w-lg-100">
|
<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}}">
|
<input type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
<small>Hides matching posts from the frontpage and collapses matching comments.</small>
|
<small>Hides matching posts from the frontpage and collapses matching comments.</small>
|
||||||
<div class="input-group mb-2">
|
<div class="input-group mb-2">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue