#36171: When saving an object(null=True, blank=True) with an empty string
__str__
in the admin page.
-------------------------------+--------------------------------------
Reporter: Antoliny | Owner: Antoliny
Type: Bug | Status: closed
Component: contrib.admin | Version: 5.1
Severity: Normal | Resolution: invalid
Keywords: blank, str | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Sarah Boyce):
* resolution: => invalid
* status: assigned => closed
Comment:
To me, the issue here is in the string method should always return a
string (eg. `return self.author or ""`)
If you want to keep spaces, you will need a custom form with `strip=False`
(see https://docs.djangoproject.com/en/5.1/ref/forms/fields/#charfield)
--
Ticket URL: <https://code.djangoproject.com/ticket/36171#comment:4>
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 view this discussion visit
https://groups.google.com/d/msgid/django-updates/01070194d5ce4318-e440db14-5e5e-40f4-8950-c1c332db3087-000000%40eu-central-1.amazonses.com.