Skip to content

Commit

Permalink
OpenConceptLab/ocl_issues#1319 | concepts | updated as per pylint2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Jun 7, 2022
1 parent 771207c commit 2f9d1c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 6 additions & 7 deletions core/concepts/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ class Meta:
'uuid', 'external_id', 'type', 'locale', 'locale_preferred'
)

@staticmethod
def create(attrs, instance=None): # pylint: disable=arguments-differ
def create(self, validated_data, instance=None): # pylint: disable=arguments-differ
concept_desc = instance if instance else LocalizedText()
concept_desc.name = attrs.get('name', concept_desc.name)
concept_desc.locale = attrs.get('locale', concept_desc.locale)
concept_desc.locale_preferred = attrs.get('locale_preferred', concept_desc.locale_preferred)
concept_desc.type = attrs.get('type', concept_desc.type)
concept_desc.external_id = attrs.get('external_id', concept_desc.external_id)
concept_desc.name = validated_data.get('name', concept_desc.name)
concept_desc.locale = validated_data.get('locale', concept_desc.locale)
concept_desc.locale_preferred = validated_data.get('locale_preferred', concept_desc.locale_preferred)
concept_desc.type = validated_data.get('type', concept_desc.type)
concept_desc.external_id = validated_data.get('external_id', concept_desc.external_id)
concept_desc.save()
return concept_desc

Expand Down
3 changes: 1 addition & 2 deletions core/concepts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ def get_object(self, queryset=None):


class ConceptCollectionMembershipView(ConceptBaseView, ListWithHeadersMixin):
@staticmethod
def get_serializer_class():
def get_serializer_class(self):
from core.collections.serializers import CollectionVersionListSerializer
return CollectionVersionListSerializer

Expand Down

0 comments on commit 2f9d1c9

Please sign in to comment.