Skip to content

Commit

Permalink
[1.7.x] Refs #23621 -- Fixed warning message when reloading models.
Browse files Browse the repository at this point in the history
Backport of aabb584 from master
  • Loading branch information
knbk authored and timgraham committed Jun 30, 2015
1 parent 1efda84 commit 9bd3a23
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/apps/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def register_model(self, app_label, model):
warnings.warn(
"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),
"most notably with related models." % (app_label, model_name),
RuntimeWarning, stacklevel=2)
else:
raise RuntimeError(
Expand Down
2 changes: 1 addition & 1 deletion tests/apps/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def test_model_clash(self):
self.assertEqual(len(w), 1)
self.assertTrue(issubclass(w[-1].category, RuntimeWarning))
self.assertEqual(str(w[-1].message),
"Model 'southponies.apps' was already registered. "
"Model 'apps.southponies' was already registered. "
"Reloading models is not advised as it can lead to inconsistencies, "
"most notably with related models.")

Expand Down

0 comments on commit 9bd3a23

Please sign in to comment.