forked from rDrama/rDrama
1
0
Fork 0

bbbbbbbbbbbbbbbb

master
Aevann1 2022-01-16 03:47:21 +02:00
parent 9c6d064b4a
commit 8ed146a733
5 changed files with 11 additions and 13 deletions

View File

@ -180,7 +180,7 @@ def buy(v, award):
@auth_required
def award_post(pid, v):
if v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
kind = request.values.get("kind", "").strip()
@ -366,7 +366,7 @@ def award_post(pid, v):
@auth_required
def award_comment(cid, v):
if v.shadowbanned: return render_template('errors/500.html', error=True, v=v), 500
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
kind = request.values.get("kind", "").strip()

View File

@ -484,7 +484,6 @@ def api_comment(v):
'notification': {
'title': f'New reply by @{v.username}',
'body': notifbody,
'click_action': 'android.intent.category.DEFAULT',
},
'data': {
'url': f'comment/{c.id}?context=9&read=true#context',

View File

@ -8,7 +8,7 @@ from files.__main__ import app, limiter
@app.errorhandler(400)
def error_400(e):
if request.headers.get("Authorization"): return {"error": "400 Bad Request"}, 400
else: return render_template('errors/400.html', error=True), 400
else: return render_template('errors/400.html', err=True), 400
@app.errorhandler(401)
def error_401(e):
@ -25,25 +25,25 @@ def error_401(e):
@app.errorhandler(403)
def error_403(e):
if request.headers.get("Authorization"): return {"error": "403 Forbidden"}, 403
else: return render_template('errors/403.html', error=True), 403
else: return render_template('errors/403.html', err=True), 403
@app.errorhandler(404)
def error_404(e):
if request.headers.get("Authorization"): return {"error": "404 Not Found"}, 404
else: return render_template('errors/404.html', error=True), 404
else: return render_template('errors/404.html', err=True), 404
@app.errorhandler(405)
def error_405(e):
if request.headers.get("Authorization"): return {"error": "405 Method Not Allowed"}, 405
else: return render_template('errors/405.html', error=True), 405
else: return render_template('errors/405.html', err=True), 405
@app.errorhandler(429)
def error_429(e):
if request.headers.get("Authorization"): return {"error": "429 Too Many Requests"}, 429
else: return render_template('errors/429.html', error=True), 429
else: return render_template('errors/429.html', err=True), 429
@app.errorhandler(500)
@ -51,7 +51,7 @@ def error_500(e):
g.db.rollback()
if request.headers.get("Authorization"): return {"error": "500 Internal Server Error"}, 500
else: return render_template('errors/500.html', error=True), 500
else: return render_template('errors/500.html', err=True), 500
@app.post("/allow_nsfw")

View File

@ -452,7 +452,6 @@ def message2(v, username):
'notification': {
'title': f'New message from @{v.username}',
'body': notifbody,
'click_action': 'android.intent.category.DEFAULT',
},
'data': {
'url': f'notifications',

View File

@ -15,7 +15,7 @@
</a>
</div>
<div class="flex-grow-1 d-fl d-none d-md-block">
<form class="form-inline search flex-nowrap mx-0 mx-lg-auto" {% if error %}style="margin-right:40rem!important"{% endif %} action="{% if request.path.startswith('/search') %}{{request.path}}{% else %}/search/posts/{% endif %}" method="get">
<form class="form-inline search flex-nowrap mx-0 mx-lg-auto" {% if err %}style="margin-right:40rem!important"{% endif %} action="{% if request.path.startswith('/search') %}{{request.path}}{% else %}/search/posts/{% endif %}" method="get">
<input autocomplete="off" class="form-control w-100" type="search" placeholder="Search" aria-label="Search" name="q" value="{{request.values.get('q', '')}}">
<span class="input-group-append">
<span class="input-group-text border-0 bg-transparent" style="margin-left: -2.5rem;">
@ -24,7 +24,7 @@
</span>
</form>
</div>
{% if not error %}
{% if not err %}
<a class="mobile-nav-icon d-md-none" href="/random"><i class="fas fa-random align-middle text-gray-500 black"></i></a>
{% if v and v.admin_level > 1 %}
<a class="mobile-nav-icon d-md-none" href="/admin"><i class="fas fa-crown align-middle text-gray-500 black"></i></a>
@ -226,6 +226,6 @@
}
</style>
{% if v and not error %}
{% if v and not err %}
<div id="formkey" class="d-none">{{v.formkey}}</div>
{% endif %}