Skip to content

Commit

Permalink
Fixing build | pylint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Nov 9, 2021
1 parent 8f6fea4 commit 92485be
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
14 changes: 6 additions & 8 deletions core/collections/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,12 @@ def get_object(self, queryset=None):
return instance

def put(self, request, **kwargs): # pylint: disable=unused-argument
result = self.perform_update()
return Response(
dict(state=result.state, task=result.task_id, queue='concurrent'), status=status.HTTP_202_ACCEPTED)
self.perform_update()
return Response(status=status.HTTP_202_ACCEPTED)

def perform_update(self):
instance = self.get_object()
return instance.update_children_counts()
instance.update_children_counts()


class CollectionVersionSummaryView(CollectionBaseView, RetrieveAPIView):
Expand All @@ -639,13 +638,12 @@ def get_object(self, queryset=None):
return instance

def put(self, request, **kwargs): # pylint: disable=unused-argument
result = self.perform_update()
return Response(
dict(state=result.state, task=result.task_id, queue='concurrent'), status=status.HTTP_202_ACCEPTED)
self.perform_update()
return Response(status=status.HTTP_202_ACCEPTED)

def perform_update(self):
instance = self.get_object()
return instance.update_children_counts()
instance.update_children_counts()


class CollectionLatestVersionSummaryView(CollectionVersionBaseView, RetrieveAPIView, UpdateAPIView):
Expand Down
7 changes: 6 additions & 1 deletion core/concepts/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,12 @@ class Meta:
models.Index(name='concepts_public_conditional', fields=['public_access'],
condition=(Q(is_active=True) & Q(retired=False) & Q(is_latest_version=True) &
~Q(public_access='None'))),
GinIndex(name='concepts_uri_trgm_id_gin_idx', fields=['uri', 'id'], opclasses=['gin_trgm_ops', 'int8_ops'], condition=Q(is_latest_version=True))
GinIndex(
name='concepts_uri_trgm_id_gin_idx',
fields=['uri', 'id'],
opclasses=['gin_trgm_ops', 'int8_ops'],
condition=Q(is_latest_version=True)
)
] + VersionedModel.Meta.indexes

external_id = models.TextField(null=True, blank=True)
Expand Down
12 changes: 5 additions & 7 deletions core/sources/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,9 +446,8 @@ def get_object(self, queryset=None):
return instance

def put(self, request, **kwargs): # pylint: disable=unused-argument
result = self.perform_update()
return Response(
dict(state=result.state, task=result.task_id, queue='concurrent'), status=status.HTTP_201_CREATED)
self.perform_update()
return Response(status=status.HTTP_202_ACCEPTED)

def perform_update(self):
instance = self.get_object()
Expand All @@ -469,13 +468,12 @@ def get_object(self, queryset=None):
return instance

def put(self, request, **kwargs): # pylint: disable=unused-argument
result = self.perform_update()
return Response(
dict(state=result.state, task=result.task_id, queue='concurrent'), status=status.HTTP_202_ACCEPTED)
self.perform_update()
return Response(status=status.HTTP_202_ACCEPTED)

def perform_update(self):
instance = self.get_object()
return instance.update_children_counts()
instance.update_children_counts()


class SourceLatestVersionSummaryView(SourceVersionBaseView, RetrieveAPIView, UpdateAPIView):
Expand Down

0 comments on commit 92485be

Please sign in to comment.