From 4318b9211eeb74c46620c2cb07ed1d9628e92acd Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Tue, 6 Nov 2018 12:59:32 +0100 Subject: [PATCH] Debug --- comments/views.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/comments/views.py b/comments/views.py index 543d49c9f..1f62b7f16 100644 --- a/comments/views.py +++ b/comments/views.py @@ -79,9 +79,10 @@ def vet_submitted_comment(request, comment_id): # Update `latest_activity` fields content_object = comment.content_object - content_object.__class__.objects.filter(id=content_object.id).update( - latest_activity=timezone.now()) - content_object.refresh_from_db() + if hasattr(content_object, 'latest_activity'): + content_object.__class__.objects.filter(id=content_object.id).update( + latest_activity=timezone.now()) + content_object.refresh_from_db() if isinstance(content_object, Submission): # Add events to Submission and send mail to author of the Submission -- GitLab