Skip to content

Commit

Permalink
prospector cleanup onadata/libs/serializers
Browse files Browse the repository at this point in the history
  • Loading branch information
ukanga committed Aug 23, 2022
1 parent 5e3f352 commit 86a856a
Show file tree
Hide file tree
Showing 37 changed files with 891 additions and 639 deletions.
7 changes: 2 additions & 5 deletions onadata/libs/serializers/attachment_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
Attachments serializer.
"""

from six import itervalues

from rest_framework import serializers
from six import itervalues

from onadata.apps.logger.models.attachment import Attachment
from onadata.apps.logger.models.instance import get_attachment_url
from onadata.apps.logger.models.instance import Instance
from onadata.apps.logger.models.instance import Instance, get_attachment_url
from onadata.libs.utils.decorators import check_obj


Expand Down Expand Up @@ -110,7 +108,6 @@ def get_medium_download_url(self, obj):
return request.build_absolute_uri(path) if request else path
return ""

# pylint: disable=no-self-use
def get_field_xpath(self, obj):
"""
Return question xpath
Expand Down
3 changes: 0 additions & 3 deletions onadata/libs/serializers/clone_xform_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class CloneXFormSerializer(serializers.Serializer):
username = serializers.CharField(max_length=255)
project = ProjectField(required=False)

# pylint: disable=no-self-use
def create(self, validated_data):
"""Uses the CloneXForm class to clone/copy an XForm.
Expand All @@ -29,7 +28,6 @@ def create(self, validated_data):

return instance

# pylint: disable=no-self-use
def update(self, instance, validated_data):
instance.xform = validated_data.get("xform", instance.xform)
instance.username = validated_data.get("username", instance.username)
Expand All @@ -38,7 +36,6 @@ def update(self, instance, validated_data):

return instance

# pylint: disable=no-self-use
def validate_username(self, value):
"""Check that the username exists"""
# pylint: disable=invalid-name
Expand Down
Loading

0 comments on commit 86a856a

Please sign in to comment.