From e78d6b406bede7c021aaecf7ae2c8c893e0ea84a Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Thu, 22 Mar 2012 08:49:48 +0000 Subject: Reverted parts of r16963 to fix a regression on the creation of permissions on proxy models. Refs #17904. Thanks koenb for the report and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17776 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/auth/management/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py index e792597778..b516507277 100644 --- a/django/contrib/auth/management/__init__.py +++ b/django/contrib/auth/management/__init__.py @@ -31,8 +31,8 @@ def create_permissions(app, created_models, verbosity, **kwargs): searched_perms = list() # The codenames and ctypes that should exist. ctypes = set() - ctypes_for_models = ContentType.objects.get_for_models(*app_models) - for klass, ctype in ctypes_for_models.iteritems(): + for klass in app_models: + ctype = ContentType.objects.get_for_model(klass) ctypes.add(ctype) for perm in _get_all_permissions(klass._meta): searched_perms.append((ctype, perm)) -- cgit v1.3