#25616: Add note regarding missing dependencies on LookupError for migrations
--------------------------------------+--------------------
     Reporter:  mcfletch              |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Migrations            |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  1                     |      UI/UX:  0
--------------------------------------+--------------------
 If you have a product package that includes migrations which depend on a
 plugin package, and you forget to include a dependency on the migration,
 you wind up with a confusing error message (raised from
 Apps.get_app_config):
 {{{
  LookupError("No installed app with label '%s'"%(label,))
 }}}
 where label is the name of the "missing" app. Which then leads the user to
 trying to figure out why the app, which is in settings.py is not showing
 up.

 It would be helpful, in `django.db.migrations.state` if we were to
 annotate the LookupError with the common issue the user is likely seeing,
 something like (on StateApps):
 {{{
     def get_app_config(self, app_label):
         try:
             return super(StateApps, self).get_app_config(app_label)
         except LookupError as err:
             err.args += ('Possibly missing dependency on a migration?', )
             raise
 }}}
 I'm not attached to the particular implementation or wording, just
 suggesting that the error message should be cleaner in the migrations-
 can't-find-app case, which is different than the general "can't find an
 app of that name" case.

--
Ticket URL: <https://code.djangoproject.com/ticket/25616>
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/051.53ec7a10431238606b66e3760d67f88b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to