diff --git a/drama/classes/__init__.py b/drama/classes/__init__.py index 49273bd4d..e2482845c 100644 --- a/drama/classes/__init__.py +++ b/drama/classes/__init__.py @@ -4,7 +4,6 @@ from .boards import * from .board_relationships import * from .clients import * from .comment import * -from .custom_errors import * from .domains import Domain from .flags import * from .user import * diff --git a/drama/classes/custom_errors.py b/drama/classes/custom_errors.py deleted file mode 100644 index 55bf4d445..000000000 --- a/drama/classes/custom_errors.py +++ /dev/null @@ -1,5 +0,0 @@ -class PaymentRequired(Exception): - status_code=402 - def __init__(self): - Exception.__init__(self) - self.status_code=402 diff --git a/drama/routes/comments.py b/drama/routes/comments.py index 17889a0a7..0b7356e8e 100644 --- a/drama/routes/comments.py +++ b/drama/routes/comments.py @@ -25,7 +25,7 @@ beams_client = PushNotifications( @auth_required def banawardcomment(comment_id, v): - if not v.banawards > 0: abort(402) + if not v.banawards > 0: return render_template("errors/402.html", v=v) comment = g.db.query(Comment).filter_by(id=comment_id).first() if not comment: abort(400) diff --git a/drama/routes/errors.py b/drama/routes/errors.py index b6a094a81..b784ed453 100644 --- a/drama/routes/errors.py +++ b/drama/routes/errors.py @@ -2,12 +2,10 @@ import jinja2.exceptions from drama.helpers.wrappers import * from drama.helpers.session import * -from drama.classes.custom_errors import * from flask import * from urllib.parse import quote, urlencode import time -from drama.__main__ import app, r, cache, db_session -import gevent +from drama.__main__ import app # Errors @@ -27,14 +25,6 @@ def error_401(e): else: return redirect(output) -@app.errorhandler(402) -@auth_desired -@api() -def error_402(e, v): - return{"html": lambda: (render_template('errors/402.html', v=v), 402), - "api": lambda: (jsonify({"error": "402 Payment Required"}), 402) - } - @app.errorhandler(403) @auth_desired @api() diff --git a/drama/routes/posts.py b/drama/routes/posts.py index c57a47dc0..b697a2ae4 100644 --- a/drama/routes/posts.py +++ b/drama/routes/posts.py @@ -49,7 +49,7 @@ def resize(): @auth_required def postbanaward(post_id, v): - if not v.banawards > 0: abort(402) + if not v.banawards > 0: return render_template("errors/402.html", v=v) post = g.db.query(Submission).filter_by(id=post_id).first() if not post: abort(400)