Make wagtailadmin migrations re-runnable

pull/2073/head
Benjamin Bach 2015-12-28 15:25:56 +01:00
rodzic 56c85f8984
commit 9a3bfb8dac
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -13,20 +13,20 @@ def create_admin_access_permissions(apps, schema_editor):
# Add a fake content type to hang the 'can access Wagtail admin' permission off.
# The fact that this doesn't correspond to an actual defined model shouldn't matter, I hope...
if django.VERSION >= (1, 8):
wagtailadmin_content_type = ContentType.objects.create(
wagtailadmin_content_type, created = ContentType.objects.get_or_create(
app_label='wagtailadmin',
model='admin'
)
else:
# Django 1.7 and below require a content type name
wagtailadmin_content_type = ContentType.objects.create(
wagtailadmin_content_type, created = ContentType.objects.get_or_create(
app_label='wagtailadmin',
model='admin',
name='Wagtail admin'
)
# Create admin permission
admin_permission = Permission.objects.create(
admin_permission, created = Permission.objects.get_or_create(
content_type=wagtailadmin_content_type,
codename='access_admin',
name='Can access Wagtail admin'