From 2d20423736d5dfa19527bc0e0d58d071ac7322ca Mon Sep 17 00:00:00 2001 From: moanos Date: Sun, 29 Sep 2024 17:18:47 +0200 Subject: [PATCH] fix: use ownerfor subscriptions --- src/fellchensammlung/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fellchensammlung/views.py b/src/fellchensammlung/views.py index 678c339..4d9f28c 100644 --- a/src/fellchensammlung/views.py +++ b/src/fellchensammlung/views.py @@ -88,14 +88,14 @@ def adoption_notice_detail(request, adoption_notice_id): # Auto-subscribe user to adoption notice subscription, created = Subscriptions.objects.get_or_create(adoption_notice=adoption_notice, - user=request.user) + owner=request.user) subscription.save() # Notify users that a comment was added for subscription in adoption_notice.get_subscriptions(): # Create a notification but only if the user is not the one that posted the comment - if subscription.user != request.user: - notification = CommentNotification(user=subscription.user, + if subscription.owner != request.user: + notification = CommentNotification(user=subscription.owner, title=f"{adoption_notice.name} - Neuer Kommentar", text=f"{request.user}: {comment_instance.text}", comment=comment_instance)