Skip to content

Commit d793580

Browse files
authored
Merge pull request #67 from justinsg/master
Don't trim attribute values when field.max_length is None
2 parents 2f2c9d8 + 3f1b84c commit d793580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

djangosaml2/backends.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _set_attribute(self, obj, attr, value):
272272
Return True if the attribute was changed and False otherwise.
273273
"""
274274
field = obj._meta.get_field(attr)
275-
if len(value) > field.max_length:
275+
if field.max_length is not None and len(value) > field.max_length:
276276
cleaned_value = value[:field.max_length]
277277
logger.warn('The attribute "%s" was trimmed from "%s" to "%s"',
278278
attr, value, cleaned_value)

0 commit comments

Comments
 (0)