Skip to content

Commit

Permalink
Handling new message types in ListField
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlaszczuk committed Apr 3, 2017
1 parent 97d0263 commit 15b49b7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion rest_framework_friendly_errors/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ def get_field_kwargs(self, field, field_data):
'length': len(field.parent.data.get(
field.source, ''))})
elif field_type in self.field_map['composite']:
kwargs.update({'input_type': type(field_data).__name__})
kwargs.update({'input_type': type(field_data).__name__,
'max_length': getattr(field, 'max_length', None),
'min_length': getattr(field, 'min_length', None)})
elif field_type in self.field_map['relation']:
kwargs.update({'pk_value': field_data,
'data_type': type(field_data).__name__,
Expand Down
2 changes: 1 addition & 1 deletion rest_framework_friendly_errors/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
'invalid_image': 2111},

'ListField': {'required': 2006, 'null': 2026, 'not_a_list': 2122,
'empty': 2015},
'empty': 2015, "max_length": 2041, "min_length": 2051},
'DictField': {'required': 2006, 'null': 2026, 'not_a_dict': 2131,
'empty': 2015},
'JSONField': {'required': 2006, 'invalid': 2141, 'null': 2026},
Expand Down

0 comments on commit 15b49b7

Please sign in to comment.