aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/notifications
diff options
context:
space:
mode:
authorJessica Tallon <tsyesika@tsyesika.se>2016-03-01 11:58:38 +0000
committerJessica Tallon <tsyesika@tsyesika.se>2016-03-01 12:04:08 +0000
commit161bc6b2c18f2d20eb759725b2df7fc7ac4a2728 (patch)
tree7e10e43dcc6fcd85e8f9e366f2e10dd0152745bc /mediagoblin/notifications
parent1db8690fe9dc625bc648e04493d075cad76689cc (diff)
downloadmediagoblin-161bc6b2c18f2d20eb759725b2df7fc7ac4a2728.tar.lz
mediagoblin-161bc6b2c18f2d20eb759725b2df7fc7ac4a2728.tar.xz
mediagoblin-161bc6b2c18f2d20eb759725b2df7fc7ac4a2728.zip
Fix #5376 - Ensure links have correct ID
This ensures that links to comments have the correct ID (the ID of the Comment object) as well as fixing deletion on reports and fixing a few other little things. I hope this fixes the #5376 issue, though cannot reproduce so unable to confirm.
Diffstat (limited to 'mediagoblin/notifications')
-rw-r--r--mediagoblin/notifications/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/mediagoblin/notifications/__init__.py b/mediagoblin/notifications/__init__.py
index 3ed9ba79..9d2f2b78 100644
--- a/mediagoblin/notifications/__init__.py
+++ b/mediagoblin/notifications/__init__.py
@@ -75,6 +75,11 @@ def mark_comment_notification_seen(comment_id, user):
obj_pk=comment.id,
model_type=comment.__tablename__
).first()
+
+ # If there is no GMR, there is no notification
+ if comment_gmr == None:
+ return
+
notification = Notification.query.filter_by(
user_id=user.id,
object_id=comment_gmr.id