From a789060d5fc4346951af5ca742e11ce2c898e407 Mon Sep 17 00:00:00 2001 From: Preston Holmes Date: Mon, 2 Jul 2012 15:56:29 -0700 Subject: [PATCH] add handling for an edge case I couldn't actually come up with a way to trigger this statement --- django/apps/cache.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/django/apps/cache.py b/django/apps/cache.py index 4973e74010817..d771bf7cae896 100644 --- a/django/apps/cache.py +++ b/django/apps/cache.py @@ -345,6 +345,11 @@ def register_models(self, app_label, *models): # comparing. if os.path.splitext(fname1)[0] == os.path.splitext(fname2)[0]: continue + else: + raise ImproperlyConfigured( + 'A model named %s is already registered for this app' % + model_name) + if app: app._meta.models[model_name] = model model_dict[model_name] = model