Better strategy for ThumbnailOption detection
This commit is contained in:
parent
aa66465e4e
commit
3488464ef1
3 changed files with 17 additions and 8 deletions
|
@ -10,7 +10,10 @@ class Migration(migrations.Migration):
|
|||
if 'cmsplugin_filer' not in thumbnail_model:
|
||||
dependencies = [
|
||||
('djangocms_blog', '0016_auto_20160502_1741'),
|
||||
('cmsplugin_filer_image', '0006_auto_20160427_1438')
|
||||
('cmsplugin_filer_image', '0003_mv_thumbnail_option_to_filer_20160119_1720'),
|
||||
]
|
||||
run_before = [
|
||||
('cmsplugin_filer_image', '0004_auto_20160120_0950'),
|
||||
]
|
||||
else:
|
||||
dependencies = [
|
||||
|
|
|
@ -33,11 +33,13 @@ BLOG_CURRENT_POST_IDENTIFIER = get_setting('CURRENT_POST_IDENTIFIER')
|
|||
BLOG_CURRENT_NAMESPACE = get_setting('CURRENT_NAMESPACE')
|
||||
|
||||
try: # pragma: no cover
|
||||
from filer.models import ThumbnailOption # NOQA
|
||||
thumbnail_model = 'filer.ThumbnailOption'
|
||||
except ImportError: # pragma: no cover
|
||||
from cmsplugin_filer_image.models import ThumbnailOption # NOQA
|
||||
thumbnail_model = 'cmsplugin_filer_image.ThumbnailOption'
|
||||
except ImportError: # pragma: no cover
|
||||
from filer.models import ThumbnailOption # NOQA
|
||||
|
||||
thumbnail_model = '%s.%s' % (
|
||||
ThumbnailOption._meta.app_label, ThumbnailOption.__name__
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
|
|
|
@ -9,15 +9,19 @@ from djangocms_blog.models import thumbnail_model
|
|||
class Migration(SchemaMigration):
|
||||
|
||||
if 'cmsplugin_filer' not in thumbnail_model:
|
||||
dependencies = [
|
||||
depends_on = [
|
||||
('djangocms_blog', '0018_auto__chg_field_post_main_image_full__chg_field_post_main_image_thumbn'),
|
||||
('cmsplugin_filer_image', '0014_auto__del_thumbnailoption__chg_field_filerimage_thumbnail_option')
|
||||
('cmsplugin_filer_image', '0013_mv_thumbnailoption_to_filer'),
|
||||
]
|
||||
needed_by = [
|
||||
('cmsplugin_filer_image', '0014_auto__del_thumbnailoption__chg_field_filerimage_thumbnail_option'),
|
||||
]
|
||||
else:
|
||||
dependencies = [
|
||||
depends_on = [
|
||||
('djangocms_blog', '0018_auto__chg_field_post_main_image_full__chg_field_post_main_image_thumbn'),
|
||||
]
|
||||
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
# Changing field 'Post.author'
|
||||
|
|
Loading…
Reference in a new issue