#25445: `AttributeError` when `app_config` is missing attribute `models_module` 
in
contenttypes/mananagent.py
--------------------------------------+--------------------
     Reporter:  pygeek                |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  Uncategorized         |    Version:  1.8
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  1
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 ```
     if not app_config.models_module:
         return
 ```

 The return statement is never reached since if app_config doesn't have a
 `models_module` attribute it raises an AttributeError.

 Regardless of whether to allow the return statement to catch or return an
 AttributeError, this code should perhaps be changed to be more clear. I
 suggest either raising an AttributeError explicitly or using gettattr.

 https://github.com/django/django/pull/5338

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

Reply via email to