mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Make 1.8 compatible
This commit is contained in:
parent
fcf8d5763b
commit
353c6a30de
1 changed files with 4 additions and 2 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Reference in a new issue