mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix: save notification state for unchanged comments
When we edit a comment we can enable notifications (if not yet enabled). We should also do this when the comment text is not changed. Signed-off-by: moson-mo <mo-son@mailbox.org>
This commit is contained in:
parent
36fd58d7a6
commit
ff0123b54a
2 changed files with 24 additions and 1 deletions
|
@ -312,11 +312,14 @@ async def pkgbase_comment_post(
|
|||
db_comment.Editor = request.user
|
||||
db_comment.EditedTS = now
|
||||
|
||||
if enable_notifications:
|
||||
with db.begin():
|
||||
db_notif = request.user.notifications.filter(
|
||||
PackageNotification.PackageBaseID == pkgbase.ID
|
||||
).first()
|
||||
if enable_notifications and not db_notif:
|
||||
if not db_notif:
|
||||
db.create(PackageNotification, User=request.user, PackageBase=pkgbase)
|
||||
|
||||
update_comment_render_fastapi(db_comment)
|
||||
|
||||
if not next:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue