From 1da0d958305274579d96cf8885042d8ca9024498 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 5 Mar 2022 00:47:25 +0200 Subject: [PATCH] wut --- files/routes/posts.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/files/routes/posts.py b/files/routes/posts.py index f5313cf09..60dec91b9 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -574,18 +574,20 @@ def edit_post(pid, v): - if (title != p.title or body != p.body) and v.id == p.author_id: - if int(time.time()) - p.created_utc > 60 * 3: p.edited_utc = int(time.time()) - g.db.add(p) + if title != p.title or body != p.body: - if not p.private and not p.ghost: - notify_users = NOTIFY_USERS(f'{title} {body}', v) - if notify_users: - cid = notif_comment2(p) - for x in notify_users: - add_notif(cid, x) + if v.id == p.author_id: + if int(time.time()) - p.created_utc > 60 * 3: p.edited_utc = int(time.time()) + g.db.add(p) - g.db.commit() + if not p.private and not p.ghost: + notify_users = NOTIFY_USERS(f'{title} {body}', v) + if notify_users: + cid = notif_comment2(p) + for x in notify_users: + add_notif(cid, x) + + g.db.commit() return redirect(p.permalink)