Skip to content

Commit

Permalink
Removed rendundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Mar 2, 2023
1 parent 7cb1f89 commit 41c620a
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions core/common/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,13 +665,6 @@ def verify_scope(self):
elif not has_parent_scope:
raise Http404()

def get_filter_params(self):
if self.params:
return self.params

self.__set_params()
return self.params

def __get_params(self):
kwargs = self.kwargs.copy()
if self.user_is_self and self.request.user.is_authenticated:
Expand Down Expand Up @@ -886,11 +879,7 @@ def update(self, request, **kwargs): # pylint: disable=arguments-differ
instance.extras = get(instance, 'extras', {})
instance.extras[key] = value
instance.comment = f'Updated extras: {key}={value}.'
head = instance.head
head.extras = get(head, 'extras', {})
head.extras.update(instance.extras)
instance.save()
head.save()
return Response({key: value})

def delete(self, request, *args, **kwargs):
Expand All @@ -901,11 +890,6 @@ def delete(self, request, *args, **kwargs):
del instance.extras[key]
instance.comment = f'Deleted extra {key}.'
instance.save()
if not instance.is_head:
head = instance.head
head.extras = get(head, 'extras', {})
del head.extras[key]
head.save()
return Response(status=status.HTTP_204_NO_CONTENT)

return Response(dict(detail=NOT_FOUND), status=status.HTTP_404_NOT_FOUND)

0 comments on commit 41c620a

Please sign in to comment.