This commit is contained in:
Aevann1 2022-03-05 00:47:25 +02:00
parent 36afb28fe7
commit eb9d874e66

View file

@ -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)