diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index 35e80709c..1a035ee4e 100755 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -9,9 +9,10 @@ def get_logged_in_user(): token = request.headers.get("Authorization") if not token: return None - client = g.db.query(ClientAuth).options(lazyload('*')).filter(ClientAuth.access_token == token).first() - - x = (client.user, client) if client else (None, None) + try: + client = g.db.query(ClientAuth).options(lazyload('*')).filter(ClientAuth.access_token == token).first() + x = (client.user, client) if client else (None, None) + except: x = (None, None) else: diff --git a/files/routes/admin.py b/files/routes/admin.py index af689531b..f57133c72 100755 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -873,13 +873,7 @@ def ban_post(post_id, v): post.stickied = None post.is_pinned = False post.removed_by = v.id - - ban_reason=request.values.get("reason", "") - ban_reason = CustomRenderer().render(mistletoe.Document(ban_reason)) - ban_reason = sanitize(ban_reason) - - post.ban_reason = ban_reason - + post.ban_reason = v.username g.db.add(post) @@ -997,7 +991,7 @@ def api_ban_comment(c_id, v): comment.is_banned = True comment.is_approved = 0 comment.removed_by = v.id - + comment.ban_reason = v.username g.db.add(comment) ma=ModAction( kind="ban_comment", diff --git a/files/templates/comments.html b/files/templates/comments.html index 7836f252c..f70dea4d5 100755 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -176,13 +176,9 @@
- -