diff options
| author | Loic Bistuer <loic.bistuer@gmail.com> | 2014-10-23 01:28:57 +0700 |
|---|---|---|
| committer | Loic Bistuer <loic.bistuer@gmail.com> | 2014-10-23 01:46:04 +0700 |
| commit | b62f72498af8a8cb4ddb3000421c5642bda57761 (patch) | |
| tree | c75b6c01b7ba7a0cd8dc946d963e2bb244c66912 /django | |
| parent | 8c4ca16c65174db63471f12b005f5423b61de073 (diff) | |
Improved warning message when reloading models. Refs #23621.
Thanks dfunckt and Tim Graham.
Diffstat (limited to 'django')
| -rw-r--r-- | django/apps/registry.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/apps/registry.py b/django/apps/registry.py index 55116e2809..fe53d965de 100644 --- a/django/apps/registry.py +++ b/django/apps/registry.py @@ -211,7 +211,9 @@ class Apps(object): if (model.__name__ == app_models[model_name].__name__ and model.__module__ == app_models[model_name].__module__): warnings.warn( - "Model '%s.%s' was already registered." % (model_name, app_label), + "Model '%s.%s' was already registered. " + "Reloading models is not advised as it can lead to inconsistencies, " + "most notably with related models." % (model_name, app_label), RuntimeWarning, stacklevel=2) else: raise RuntimeError( |
