Changes between Initial Version and Version 3 of Ticket #25445
- Timestamp:
- Sep 22, 2015, 11:35:49 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25445
- Property Summary `AttributeError` when `app_config` is missing attribute `models_module` in contenttypes/mananagent.py → `AttributeError` when `app_config` is missing attribute `models_module` in contenttypes/management.py
- Property Owner changed from to
- Property Status new → assigned
-
Ticket #25445 – Description
initial v3 1 ``` 1 2 {{{ 2 3 if not app_config.models_module: 3 4 return 4 ``` 5 }}} 5 6 6 The return statement is never reached since if app_config doesn't have a `models_module` attribute it raises an AttributeError.7 7 8 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. 8 The return statement is never reached since if `app_config` doesn't have a `models_module` attribute it raises an `AttributeError`. 9 10 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`. 9 11 10 12 https://github.com/django/django/pull/5338