fd
This commit is contained in:
parent
6b59636948
commit
48b34bdc91
6 changed files with 9 additions and 11 deletions
|
@ -163,8 +163,6 @@ function submitFormAjax(e) {
|
||||||
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
|
var myToast = bootstrap.Toast.getOrCreateInstance(document.getElementById('toast-post-success'));
|
||||||
myToast.show();
|
myToast.show();
|
||||||
return true
|
return true
|
||||||
} else if (xhr.status >= 300 && xhr.status < 400) {
|
|
||||||
location.href = JSON.parse(xhr.response)["redirect"]
|
|
||||||
} else {
|
} else {
|
||||||
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
document.getElementById('toast-post-error-text').innerText = "Error, please try again later."
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -421,8 +421,8 @@ def award_post(pid, v):
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
if request.referrer and len(request.referrer) > 1:
|
if request.referrer and len(request.referrer) > 1:
|
||||||
if request.referrer == f'{SITE_FULL}/submit': return redirect(post.permalink)
|
if request.referrer == f'{SITE_FULL}/submit': return redirect(post.permalink)
|
||||||
elif request.host in request.referrer: return redirect(request.referrer)
|
elif request.referrer.startswith(request.host): return redirect(request.referrer)
|
||||||
return redirect(f"{SITE_FULL}/")
|
return redirect(SITE_FULL)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/award_comment/<cid>")
|
@app.post("/award_comment/<cid>")
|
||||||
|
@ -646,9 +646,9 @@ def award_comment(cid, v):
|
||||||
g.db.add(author)
|
g.db.add(author)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
if request.referrer and len(request.referrer) > 1 and request.host in request.referrer:
|
if request.referrer and len(request.referrer) > 1 and request.referrer.startswith(request.host):
|
||||||
return redirect(request.referrer)
|
return redirect(request.referrer)
|
||||||
return redirect(f"{SITE_FULL}/")
|
return redirect(SITE_FULL)
|
||||||
|
|
||||||
@app.get("/admin/awards")
|
@app.get("/admin/awards")
|
||||||
@admin_level_required(2)
|
@admin_level_required(2)
|
||||||
|
|
|
@ -179,7 +179,7 @@ def sign_up_get(v):
|
||||||
if f.read() == "yes":
|
if f.read() == "yes":
|
||||||
return {"error": "New account registration is currently closed. Please come back later."}, 403
|
return {"error": "New account registration is currently closed. Please come back later."}, 403
|
||||||
|
|
||||||
if v: return redirect(f"{SITE_FULL}/")
|
if v: return redirect(SITE_FULL)
|
||||||
|
|
||||||
agent = request.headers.get("User-Agent", None)
|
agent = request.headers.get("User-Agent", None)
|
||||||
if not agent: abort(403)
|
if not agent: abort(403)
|
||||||
|
@ -350,7 +350,7 @@ def sign_up_post(v):
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
return redirect(f"{SITE_FULL}/")
|
return redirect(SITE_FULL)
|
||||||
|
|
||||||
|
|
||||||
@app.get("/forgot")
|
@app.get("/forgot")
|
||||||
|
|
|
@ -737,7 +737,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
<script src="/static/assets/js/userpage_v.js?a=244"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
<script src="/static/assets/js/userpage_v.js?a=244"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
<div id='tax' class="d-none">{% if v.patron or u.patron %}0{% else %}0.03{% endif %}</div>
|
||||||
<script src="/static/assets/js/userpage_v.js?a=243"></script>
|
<script src="/static/assets/js/userpage_v.js?a=244"></script>
|
||||||
<div id="username" class="d-none">{{u.username}}</div>
|
<div id="username" class="d-none">{{u.username}}</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue