Code

Ticket #7198: sql_proper_err_msg.diff

File sql_proper_err_msg.diff, 598 bytes (added by Silver_Ghost, 3 years ago)

Creates proper error message for app without models.py module.

Line 
1Index: django/db/models/loading.py
2===================================================================
3--- django/db/models/loading.py (revision 16481)
4+++ django/db/models/loading.py (working copy)
5@@ -147,6 +147,7 @@
6                     if mod is None:
7                         if emptyOK:
8                             return None
9+                        raise ImproperlyConfigured("App with label %s hasn't models.py module" % app_label)
10                     else:
11                         return mod
12             raise ImproperlyConfigured("App with label %s could not be found" % app_label)