Skip to content

Commit

Permalink
Revert "Fixed #12288 -- Validated that app names in INSTALLED_APPS ar…
Browse files Browse the repository at this point in the history
…e unique"

This reverts commit c1ec089.

There are backwards compatability concerns with this.
  • Loading branch information
timgraham committed Sep 14, 2013
1 parent 74b91b3 commit 886bb9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
5 changes: 2 additions & 3 deletions django/conf/__init__.py
Expand Up @@ -109,9 +109,8 @@ def __setattr__(self, name, value):
"to a tuple, not a string.")
elif name == "INSTALLED_APPS":
value = list(value) # force evaluation of generators on Python 3
apps = [s.split('.')[-1] for s in value]
if len(value) != len(set(apps)):
raise ImproperlyConfigured("The INSTALLED_APPS setting must contain unique app names.")
if len(value) != len(set(value)):
raise ImproperlyConfigured("The INSTALLED_APPS setting must contain unique values.")

object.__setattr__(self, name, value)

Expand Down
5 changes: 1 addition & 4 deletions tests/settings_tests/tests.py
Expand Up @@ -241,14 +241,11 @@ def tearDown(self):
def test_unique(self):
"""
An ImproperlyConfigured exception is raised if the INSTALLED_APPS contains
any duplicate appication names.
any duplicate strings.
"""
with self.assertRaises(ImproperlyConfigured):
self.settings_module.INSTALLED_APPS = ("myApp1", "myApp1", "myApp2", "myApp3")

with self.assertRaises(ImproperlyConfigured):
self.settings_module.INSTALLED_APPS = ("package1.myApp1", "package2.myApp1")


class TrailingSlashURLTests(TestCase):
"""
Expand Down

0 comments on commit 886bb9d

Please sign in to comment.