mirror of
https://github.com/fergalmoran/dss.api.git
synced 2025-12-25 10:49:16 +00:00
Fixed comments bug
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user