#26821: 'NoneType' object has no attribute 'strip'
---------------------------------+--------------------------------------
Reporter: vinaykrsharma | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: master
Severity: Release blocker | Keywords: error,form fields, strip
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------
Getting this error on admin form save.
Reason, have not any None check at:
[https://github.com/django/django/blob/master/django/forms/fields.py#L700]
Must should be check:
{{{
value = self.to_python(value)
if value:
value = value.strip()
}}}
Error Report:
{{{
...
Django Version: 1.11.dev20160629191130
Exception Location: /opt/django-trunk/django/forms/fields.py in clean,
line 700
Python Version: 3.5.1
...
}}}
The below commit caused the error:
[https://github.com/django/django/commit/267dc4adddd2882182f71a7f285a06b1d4b15af0
#diff-d7e069df501fd643847061cbdb376670]
Before that at line 230 it was returning empty string, but after it is
returning None.
--
Ticket URL: <https://code.djangoproject.com/ticket/26821>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/056.a745f8b33e59c318be5a1720bccf2041%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.