Make 1.8 compatible

This commit is contained in:
Curtis Maloney 2015-05-27 13:20:50 +10:00
parent fcf8d5763b
commit 353c6a30de

View file

@ -1,4 +1,5 @@
from django.db.models import signals
from django import VERSION
def create_perm(app, created_models, verbosity, db, **kwargs):
@ -10,10 +11,11 @@ def create_perm(app, created_models, verbosity, db, **kwargs):
from django.contrib.contenttypes.models import ContentType
if ContentType._meta.installed and Permission._meta.installed:
extra = {} if VERSION >= (1, 8) else {'name': 'config'}
content_type, created = ContentType.objects.get_or_create(
name='config',
app_label='constance',
model='config')
model='config',
**extra)
permission, created = Permission.objects.get_or_create(
name='Can change config',