#17667: App loading skips erroneous applications after first try -------------------------------------+------------------------------------- Reporter: ea2100@… | Owner: Type: Bug | Blaker0111 Component: Database layer | Status: new (models, ORM) | Version: 1.3 Severity: Normal | Resolution: Keywords: model | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by akaariai):
* cc: anssi.kaariainen@… (added) * needs_better_patch: => 0 * needs_tests: => 0 * needs_docs: => 0 * has_patch: 0 => 1 * stage: Unreviewed => Accepted Comment: Yes, it looks like there is a bug in Django. You should get the first error consistently, it should not go away with repeating the operation. This is an issue with app loading, not order_by. The problem seems to be in load_app() of loading.py: {{{ self.handled[app_name] = None self.nesting_level += 1 app_module = import_module(app_name) }}} This causes the error to be skipped on subsequent loads. Putting the import first will fix the problem. In the attached patch this is fixed. The borg-pattern of AppCache caused some testing problems, but I hope what I did is OK. For the reporter: you most likely have a couple of references to non- existing applications in your settings.INSTALLED_APPS. This causes the import errors for you. As said, the bug is that the errors should repeat. -- Ticket URL: <https://code.djangoproject.com/ticket/17667#comment:1> 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 post to this group, send email to django-updates@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.