diff --git a/djangocms_blog/migrations/0001_initial.py b/djangocms_blog/migrations/0001_initial.py index ca16ba9..e7e7198 100644 --- a/djangocms_blog/migrations/0001_initial.py +++ b/djangocms_blog/migrations/0001_initial.py @@ -17,14 +17,23 @@ ACTUAL_FILER_IMAGE_MODEL = FILER_IMAGE_MODEL or 'filer.Image' class Migration(migrations.Migration): + if 'cmsplugin_filer' not in thumbnail_model: + filer_dependencies = [ + ('filer', '0003_thumbnailoption'), + ('cmsplugin_filer_image', '0006_auto_20160427_1438') + ] + else: + filer_dependencies = [ + ('filer', '__first__'), + ('cmsplugin_filer_image', '__first__'), + ] + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), migrations.swappable_dependency(ACTUAL_FILER_IMAGE_MODEL), - ('cms', '__latest__'), - ('taggit', '__latest__'), - ('filer', '__latest__'), - ('cmsplugin_filer_image', '__latest__'), - ] + ('cms', '__first__'), + ('taggit', '__first__'), + ] + filer_dependencies operations = [ migrations.CreateModel( diff --git a/djangocms_blog/migrations/0002_post_sites.py b/djangocms_blog/migrations/0002_post_sites.py index 9a7a980..65b75be 100644 --- a/djangocms_blog/migrations/0002_post_sites.py +++ b/djangocms_blog/migrations/0002_post_sites.py @@ -7,7 +7,7 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('sites', '__latest__'), + ('sites', '__first__'), ('djangocms_blog', '0001_initial'), ] diff --git a/djangocms_blog/migrations/0009_latestpostsplugin_tags_new.py b/djangocms_blog/migrations/0009_latestpostsplugin_tags_new.py index 53860ec..045e283 100644 --- a/djangocms_blog/migrations/0009_latestpostsplugin_tags_new.py +++ b/djangocms_blog/migrations/0009_latestpostsplugin_tags_new.py @@ -31,7 +31,7 @@ def migrate_tags_reverse(apps, schema_editor): class Migration(migrations.Migration): dependencies = [ - ('taggit', '__latest__'), + ('taggit', '__first__'), ('djangocms_blog', '0008_auto_20150814_0831'), ] diff --git a/djangocms_blog/migrations/0010_auto_20150923_1151.py b/djangocms_blog/migrations/0010_auto_20150923_1151.py index fa01b5f..f7019f0 100644 --- a/djangocms_blog/migrations/0010_auto_20150923_1151.py +++ b/djangocms_blog/migrations/0010_auto_20150923_1151.py @@ -10,7 +10,7 @@ from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ - ('cms', '__latest__'), + ('cms', '__first__'), ('djangocms_blog', '0009_latestpostsplugin_tags_new'), ] diff --git a/djangocms_blog/models.py b/djangocms_blog/models.py index 8214a51..1a5874c 100644 --- a/djangocms_blog/models.py +++ b/djangocms_blog/models.py @@ -32,18 +32,12 @@ from .settings import get_setting BLOG_CURRENT_POST_IDENTIFIER = get_setting('CURRENT_POST_IDENTIFIER') BLOG_CURRENT_NAMESPACE = get_setting('CURRENT_NAMESPACE') -try: - from cmsplugin_filer_image.models import ThumbnailOption # NOQA -except ImportError: +try: # pragma: no cover from filer.models import ThumbnailOption # NOQA -try: - thumbnail_model = '%s.%s' % ( - ThumbnailOption._meta.app_label, ThumbnailOption._meta.model_name - ) -except AttributeError: - thumbnail_model = '%s.%s' % ( - ThumbnailOption._meta.app_label, ThumbnailOption._meta.module_name - ) + thumbnail_model = 'filer.ThumbnailOption' +except ImportError: # pragma: no cover + from cmsplugin_filer_image.models import ThumbnailOption # NOQA + thumbnail_model = 'cmsplugin_filer_image.ThumbnailOption' try: