502 Bad Gateway
-Don't go this way, stranger. The gate is closed, and the guards are saying:
-"We're restarting the server right now, try again in a few moments."
- -diff --git a/files/__main__.py b/files/__main__.py index e56ec0a46..d54f8703e 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -125,7 +125,7 @@ r=redis.Redis( connection_pool=redispool ) if app.config["CACHE_REDIS_URL"] else None -db_session = scoped_session(sessionmaker(bind=_engine, query_cls=RetryingQuery)) +db_session = scoped_session(sessionmaker(bind=_engine, query_cls=RetryingQuery, autoflush=False)) @app.before_request diff --git a/files/routes/errors.py b/files/routes/errors.py index 664f73c8c..811f3edf9 100644 --- a/files/routes/errors.py +++ b/files/routes/errors.py @@ -50,41 +50,6 @@ def error_405(e, v): else: return render_template('errors/405.html', v=v), 405 -@app.errorhandler(409) -@auth_desired -def error_409(e, v): - if request.headers.get("Authorization"): return {"error": "409 Conflict"}, 409 - else: return render_template('errors/409.html', v=v), 409 - - -@app.errorhandler(410) -@auth_desired -def error_410(e, v): - if request.headers.get("Authorization"): return {"error": "410 Request Payload Too Large"}, 410 - else: return render_template('errors/410.html', v=v), 410 - - -@app.errorhandler(413) -@auth_desired -def error_413(e, v): - if request.headers.get("Authorization"): return {"error": "413 Image Size Too Large"}, 413 - else: return render_template('errors/413.html', v=v), 413 - - -@app.errorhandler(418) -@auth_desired -def error_418(e, v): - if request.headers.get("Authorization"): return {"error": "418 I'm A Teapot"}, 418 - else: return render_template('errors/418.html', v=v), 418 - - -@app.errorhandler(422) -@auth_desired -def error_422(e, v): - if request.headers.get("Authorization"): return {"error": "422 Unprocessable Entity"}, 422 - else: return render_template('errors/422.html', v=v), 422 - - @app.errorhandler(429) @auth_desired def error_429(e, v): @@ -92,13 +57,6 @@ def error_429(e, v): else: return render_template('errors/429.html', v=v), 429 -@app.errorhandler(451) -@auth_desired -def error_451(e, v): - if request.headers.get("Authorization"): return {"error": "451 Unavailable For Legal Reasons"}, 451 - else: return render_template('errors/451.html', v=v), 451 - - @app.errorhandler(500) @auth_desired def error_500(e, v): @@ -108,21 +66,6 @@ def error_500(e, v): else: return render_template('errors/500.html', v=v), 500 -@app.errorhandler(502) -@auth_desired -def error_502(e, v): - if request.headers.get("Authorization"): return {"error": "502 Bad Gateway"}, 502 - else: return render_template('errors/502.html', v=v), 502 - - -@app.errorhandler(503) -@auth_desired -def error_503(e, v): - if request.headers.get("Authorization"): return {"error": "503 Service Unavailable"}, 503 - else: return render_template('errors/503.html', v=v), 503 - - - @app.post("/allow_nsfw") def allow_nsfw(): diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 1ebf1eb5a..fe5aaecab 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -19,10 +19,6 @@ - - {% if v %} @@ -111,15 +107,7 @@ - - - +
diff --git a/files/templates/bootstrap.html b/files/templates/bootstrap.html deleted file mode 100644 index 214548b81..000000000 --- a/files/templates/bootstrap.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/files/templates/default.html b/files/templates/default.html index 15a8a66c7..175b3964d 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -1,10 +1,10 @@ - {% include "bootstrap.html" %} + + {% if v and v.agendaposter %} - - - - - - - - - - {% if request.path=='/' and g.system and g.timestamp>session.get('tooltip_last_dismissed',0)+60*60*24 and (not g.system.endswith('/chrome') and not g.system.endswith('/other')) and not g.system.endswith('/webview') %} diff --git a/files/templates/errors/409.html b/files/templates/errors/409.html deleted file mode 100644 index 2e55c2fc1..000000000 --- a/files/templates/errors/409.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} -409 Conflict -{% endblock %} - -{% block pagetype %}error-409{% endblock %} - -{% block content %} ---{% endblock %} \ No newline at end of file diff --git a/files/templates/errors/410.html b/files/templates/errors/410.html deleted file mode 100644 index 3b72b8df8..000000000 --- a/files/templates/errors/410.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} -- --410 Gone -{% endblock %} - -{% block pagetype %}error-410{% endblock %} - -{% block content %} ---{% endblock %} \ No newline at end of file diff --git a/files/templates/errors/413.html b/files/templates/errors/413.html deleted file mode 100644 index cfbb05883..000000000 --- a/files/templates/errors/413.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} -- --413 Request Entity Too Large -{% endblock %} - -{% block pagetype %}error-413{% endblock %} - -{% block content %} ---{% endblock %} diff --git a/files/templates/errors/418.html b/files/templates/errors/418.html deleted file mode 100644 index 3f5dbedde..000000000 --- a/files/templates/errors/418.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} ---- - --413 Image Size Too Large
-There's a 1 MB limit to profile picture uploads, and a 16 MB limit to all other image uploads.
- -418 I'm A Teapot -{% endblock %} - -{% block pagetype %}error-418{% endblock %} - -{% block content %} ---{% endblock %} diff --git a/files/templates/errors/422.html b/files/templates/errors/422.html deleted file mode 100644 index a0a3b5f28..000000000 --- a/files/templates/errors/422.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} ---- - --418 I'm A Teapot
-You're on a new level of retardation if you somehow get this error. Do better.
- -422 Unprocessable Entity -{% endblock %} - -{% block pagetype %}error-422{% endblock %} - -{% block content %} ---{% endblock %} diff --git a/files/templates/errors/451.html b/files/templates/errors/451.html deleted file mode 100644 index e977f222f..000000000 --- a/files/templates/errors/451.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends "errors/default.html" %} - -{% block title %} ---- - --422 Unprocessable Entity
-STOP BREAKING THINGS PLEASE WHY DO WE HAVE SO MANY ERROR CODES
- -451 Unavailable For Legal Reasons -{% endblock %} - -{% block pagetype %}error-451{% endblock %} - -{% block content %} ---{% endblock %} \ No newline at end of file diff --git a/files/templates/errors/502.html b/files/templates/errors/502.html deleted file mode 100644 index 20040c6dd..000000000 --- a/files/templates/errors/502.html +++ /dev/null @@ -1,75 +0,0 @@ - - - - - ---- - --451 Unavailable For Legal Reasons
- --
fool.502 Bad Gateway - - - - - - - - - - - - - - - - - - - - {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} - {% else %} - - {% endif %} - - - - - - - - --- - - - - - - - - \ No newline at end of file diff --git a/files/templates/errors/503.html b/files/templates/errors/503.html deleted file mode 100644 index 08d8d96f7..000000000 --- a/files/templates/errors/503.html +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - ----- ------ - --502 Bad Gateway
-Don't go this way, stranger. The gate is closed, and the guards are saying:
-"We're restarting the server right now, try again in a few moments."
- -503 Service Unavailable - - - - - - - - - - - - - - {% if v %} - - {% if v.agendaposter %}{% elif v.css %}{% endif %} - {% else %} - - {% endif %} - - - - - - - - - - - - - - - - --- - - - - - - - - - - - - - - - - - - - - - - -- ---- - --- - - - - ---- - - - --503 Service Unavailable
-r{{'SITE_NAME' | app_config}} is unavailable.
-HI IT'S CARP AGAIN
- -
I'm like 95% sure this error means Aevann is restarting the server to apply a change. But I think that's also 520/521? What causes a 503? No one knows. Wait like a minute (maybe two) and see if it's still happening. It shouldn't. Good luck!- - - -- - - - - \ No newline at end of file diff --git a/files/templates/login.html b/files/templates/login.html index 6f574f7f8..956e65911 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -128,7 +128,8 @@ -{% include "bootstrap.html" %} + + diff --git a/files/templates/settings.html b/files/templates/settings.html index b30bccb51..d65eb31ec 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -3,7 +3,8 @@ - {% include "bootstrap.html" %} + + - - - -diff --git a/files/templates/settings2.html b/files/templates/settings2.html index d2d540fec..c7005fea9 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -201,30 +201,8 @@ {% block errorToasts %} {% endblock %} -{% include "bootstrap.html" %} - - - - - - - + + diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 1ea932de2..2e0bf8bb8 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -2,7 +2,8 @@ - {% include "bootstrap.html" %} + + + - - - - - - diff --git a/files/templates/submission.html b/files/templates/submission.html index 1ac5ea5e8..7395cb59b 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -192,18 +192,18 @@ {% block content %} {% if p.award_count("shit") %} - -{% set minbugs = 10*p.award_count("shit") if p.award_count("shit") <= 5 else 50 %} -{% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") <= 5 else 100 %} - + + {% set minbugs = 10*p.award_count("shit") if p.award_count("shit") <= 5 else 50 %} + {% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") <= 5 else 100 %} + {% endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index a81f555a0..b440db1bc 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -2,9 +2,9 @@ - {% include "bootstrap.html" %} + + - @@ -406,28 +406,9 @@ - - -