#32285: AppConfig.label should raise an exception when it's not a valid Python
identifier.
-------------------------------------+-------------------------------------
Reporter: Federico Capoano | Owner: Hasan
Type: | Ramezani
Cleanup/optimization | Status: closed
Component: Core (Other) | Version: 3.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Weber):
I was surprised by this error when trying to upgrade a large codebase to
3.2. This codebase's convention is to use app labels with dashes, which I
suspect still works fine (unlike labels with periods).
Is there a recommended migration path for projects like these that were
using an invalid label unknowingly? As far as I can tell, the only option
is to change the label, which looks involved: it affects things like old
migrations, db rows like content types, and maybe even table names.
If there's no simple migration path, what about changing this from an
exception to a warning? That'd still accomplish the goal of informing
users that something may break and allows cases like mine to avoid quite a
bit of pain.
--
Ticket URL: <https://code.djangoproject.com/ticket/32285#comment:11>
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 on the web visit
https://groups.google.com/d/msgid/django-updates/071.ac50fde78d9143c6dd5aa3608b410643%40djangoproject.com.