Skip to content

Commit

Permalink
Fixed migration 0010 to avoid using model classes directly (#5473) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
czpython committed Jul 5, 2016
1 parent 07723ba commit 999806c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cms/migrations/0010_migrate_use_structure.py
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
import warnings
from django.contrib.auth.models import Permission, Group
from django.contrib.contenttypes.models import ContentType

from django.conf import settings
from django.db import models, migrations


def forwards(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
Permission = apps.get_model('auth', 'Permission')
Group = apps.get_model('auth', 'Group')
user_model = apps.get_model(settings.AUTH_USER_MODEL)
ph_model = apps.get_model('cms', 'Placeholder')
page_model = apps.get_model('cms', 'Page')
Expand All @@ -30,6 +30,9 @@ def forwards(apps, schema_editor):


def backwards(apps, schema_editor):
ContentType = apps.get_model('contenttypes', 'ContentType')
Permission = apps.get_model('auth', 'Permission')
Group = apps.get_model('auth', 'Group')
user_model = apps.get_model(settings.AUTH_USER_MODEL)
ph_model = apps.get_model('cms', 'Placeholder')
ph_ctype = ContentType.objects.get(app_label=ph_model._meta.app_label, model=ph_model._meta.model_name)
Expand Down

0 comments on commit 999806c

Please sign in to comment.