From c1fb41c696b7c1712205c897cd956229dd502b6a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 14 Dec 2021 04:35:03 +0200 Subject: [PATCH 1/3] fdsfds --- files/routes/posts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index 23d6ecd534..3c1fa9773f 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -1045,12 +1045,12 @@ def submit_post(v): user = g.db.query(User).filter_by(username=username).first() if user and not v.any_block_exists(user) and user.id != v.id: notify_users.add(user.id) - for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: https://{site}{new_post.permalink}") + for x in notify_users: send_notification(x, f"@{v.username} has mentioned you: [{title}]({new_post.permalink})") for follow in v.followers: user = get_account(follow.user_id) if new_post.club and not user.club_allowed: continue - send_notification(user.id, f"@{v.username} has made a new post: [{title}](https://{site}{new_post.permalink})", True) + send_notification(user.id, f"@{v.username} has made a new post: [{title}]({new_post.permalink})", True) g.db.add(new_post) g.db.flush() From 3a9b1ecb3ee43e3d23306d797ee27be303138877 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 14 Dec 2021 20:32:22 +0200 Subject: [PATCH 2/3] fdsdsf --- files/helpers/wrappers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index ad1e4db5f0..83c610b86b 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -47,7 +47,7 @@ def auth_desired(f): v = get_logged_in_user() - if request.host == 'old.rdrama.net' and not (v and v.admin_level): + if request.host == 'old.rdrama.net' and not (v and v.admin_level) and '/login' not in request.path: if request.headers.get("Authorization"): return {"error": "403 Forbidden"}, 403 else: return render_template('errors/403.html', v=v), 403 check_ban_evade(v) From 98b6cc7f22e52e382039bca004c9a302f8b5e31e Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 14 Dec 2021 20:35:56 +0200 Subject: [PATCH 3/3] sdfsfd --- files/classes/comment.py | 4 ++-- files/routes/front.py | 1 + files/routes/search.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/files/classes/comment.py b/files/classes/comment.py index 628f8b8335..5040df5a1e 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -265,14 +265,14 @@ class Comment(Base): data= {'is_banned': True, 'ban_reason': self.ban_reason, 'id': self.id, - 'post': self.post.id, + 'post': self.post.id if self.post else 0, 'level': self.level, 'parent': self.parent_fullname } elif self.deleted_utc > 0: data= {'deleted_utc': self.deleted_utc, 'id': self.id, - 'post': self.post.id, + 'post': self.post.id if self.post else 0, 'level': self.level, 'parent': self.parent_fullname } diff --git a/files/routes/front.py b/files/routes/front.py index 01d8d8881b..d03e257b73 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -105,6 +105,7 @@ def notifications(v): if c not in listing: listing.append(c) + if request.headers.get("Authorization"): return {"data":[x.json for x in listing]} return render_template("notifications.html", v=v, diff --git a/files/routes/search.py b/files/routes/search.py index 76ea5272a0..a0f0b51e5b 100644 --- a/files/routes/search.py +++ b/files/routes/search.py @@ -249,7 +249,7 @@ def searchcomments(v): comments = get_comments(ids, v=v) - if request.headers.get("Authorization"): return [x.json for x in comments] + if request.headers.get("Authorization"): return {"data":[x.json for x in comments]} else: return render_template("search_comments.html", v=v, query=query, total=total, page=page, comments=comments, sort=sort, t=t, next_exists=next_exists)