#24523: django.apps.registry.populate() does not handle failures in
app_config.ready()
--------------------------------------+------------------------------------
Reporter: kalium99 | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Comment (by kalium99):
In my reading of the docs, they do explicitly say (although, in a weakly
worded way) that the `ready()` method should potentially be idempotent,
and that the burden is on the developer to ensure their application is
robust enough to handle multiple calls to `ready()`.
...In the usual initialization process, the ready method is only called
once by Django. But in some corner cases, particularly in tests which are
fiddling with installed applications, ready might be called more than
once. In that case, either write idempotent methods, or put a flag on your
AppConfig classes to prevent re-running code which should be executed
exactly one time.
https://docs.djangoproject.com/en/1.8/ref/applications/#django.apps.AppConfig.ready
--
Ticket URL: <https://code.djangoproject.com/ticket/24523#comment:8>
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/066.9ddebf3be058f14335b568dac4b03c27%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.