Opened 3 years ago

Closed 3 years ago

#33196 closed Cleanup/optimization (wontfix)

AppConfig.label identifier enforcement unnecessarily complicates upgrades for some apps

Reported by: Simon Weber Owned by: nobody
Component: Core (Other) Version: 3.2
Severity: Normal Keywords:
Cc: Simon Weber, Carlton Gibson Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

#32285 introduced a new ImproperlyConfigured exception when an app label isn't a valid python identifier. This was intended to prevent confusion caused by periods in app labels.

But, this also prevents using app labels containing things like hyphens, which seem to still work fine when the check is removed. There's a few mentions online where this has caused surprises, such as for fontawesome and django-greppelli. I suspect this will get worse as we get closer to 3.1 support ending.

Notably, the docs say the label should be an identifier, not that it must. So, what do you think about changing the exception to something that can be overridden, like a warning or system check? This is still a strong signal to users about the source of potential problems, but also saves a lot of pain in cases like mine -- as it stands, I'd need to update thousands of previously-working references across project source, migrations, and databases.

I'd be happy to write the patch if we can agree on an approach.

Change History (2)

comment:1 by Simon Weber, 3 years ago

Cc: Simon Weber added

comment:2 by Mariusz Felisiak, 3 years ago

Cc: Carlton Gibson added
Resolution: wontfix
Status: newclosed

Using AppConfig.label other than valid Python identifier has never been officially supported. Removing this exception would also force changing this long-standing decision and we'd have to add tests for such apps.

So, what do you think about changing the exception to something that can be overridden, like a warning or system check?

I don't think that's an option.

Please start a discussion on the DevelopersMailingList and follow the triaging guidelines with regards to wontfix tickets, if you don't agree.

Note: See TracTickets for help on using tickets.
Back to Top