Skip to content

Commit

Permalink
Remove unused imports and PEP8 adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlaszczuk committed Apr 14, 2016
1 parent f044da7 commit a606097
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions rest_framework_friendly_errors/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def get_field_kwargs(self, field, field_data):
elif field_type in self.field_map['file']:
kwargs.update({'max_length': field.max_length,
'length': len(field.parent.data.get(
field.source, ''))})
field.source, ''))})
elif field_type in self.field_map['composite']:
kwargs.update({'input_type': type(field_data).__name__})
elif field_type in self.field_map['relation']:
Expand All @@ -115,8 +115,8 @@ def does_not_exist_many_to_many_handler(self, field, message, kwargs):

def find_key(self, field, message, field_name):
kwargs = self.get_field_kwargs(
field, self.initial_data.get(field_name)
)
field, self.initial_data.get(field_name)
)
for key in field.error_messages:
if key == 'does_not_exist' \
and isinstance(kwargs.get('value'), list) \
Expand Down
2 changes: 1 addition & 1 deletion tests/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from rest_framework.exceptions import APIException, NotFound
from rest_framework.decorators import api_view, permission_classes
from rest_framework.permissions import IsAuthenticated, IsAdminUser
from rest_framework.permissions import IsAuthenticated


@api_view(['GET'])
Expand Down

0 comments on commit a606097

Please sign in to comment.