Skip to content

Commit

Permalink
add handling for an edge case
Browse files Browse the repository at this point in the history
I couldn't actually come up with a way to trigger this statement
  • Loading branch information
ptone committed Aug 28, 2012
1 parent 8f4fa2e commit 4f521ed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions django/apps/cache.py
Expand Up @@ -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
Expand Down

0 comments on commit 4f521ed

Please sign in to comment.