Skip to content
Snippets Groups Projects
Commit 23e86d6f authored by Art's avatar Art :lizard:
Browse files

Revert 92815998 because it breaks creation of predefined groups with django.contrib permissions

This reverts commit 92815998.
parent ac8e818a
Branches
No related tags found
No related merge requests found
......@@ -16,14 +16,13 @@ def get_or_create_permission(codename, create_with_name=None):
:return: permission object
Ensures the permissions exists. Creates it if needed.
"""
user_content_type = get_user_content_type()
try:
perm = Permission.objects.get(codename=codename, content_type=user_content_type)
perm = Permission.objects.get(codename=codename)
except Permission.DoesNotExist:
perm = Permission.objects.create(
codename=codename,
name=create_with_name or codename,
content_type=user_content_type
content_type=get_user_content_type()
)
logger.info("Created permission: {0}".format(perm))
return perm
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment