mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Merge pull request #103 from funkybob/master
[Fixes #93] Make models.py 1.8 compatible
This commit is contained in:
commit
95d751a7ce
2 changed files with 6 additions and 3 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',
|
||||
|
|
|
|||
3
tox.ini
3
tox.ini
|
|
@ -3,7 +3,8 @@ envlist =
|
|||
py26-django-14,
|
||||
py27-django-14,
|
||||
{py26,py27,py32,py33,py34,pypy}-django-{15,16},
|
||||
{py27,py32,py33,py34,pypy}-django-{17,master}
|
||||
{py27,py32,py33,py34,pypy}-django-17
|
||||
{py27,py33,py34,pypy}-django-master
|
||||
|
||||
[testenv]
|
||||
basepython =
|
||||
|
|
|
|||
Loading…
Reference in a new issue