Fixed comments bug

This commit is contained in:
Fergal Moran
2015-11-13 20:33:47 +00:00
parent 9f03b916d7
commit 2d6acb6281
2 changed files with 8 additions and 2 deletions

View File

@@ -402,7 +402,7 @@ class CommentSerializer(serializers.HyperlinkedModelSerializer):
def get_can_edit(self, obj):
user = self.context['request'].user
if user is not None and user.is_authenticated():
if user is not None and obj.user is not None and user.is_authenticated():
return user.is_staff or obj.user.id == user.userprofile.id
return False