awesto / django-shop

A Django based shop system
http://www.django-shop.org
BSD 3-Clause "New" or "Revised" License
3.2k stars 1.03k forks source link

0.9.3 upgrade issue with djangocms-cascade==0.11.0 #444

Closed dinoperovic closed 7 years ago

dinoperovic commented 7 years ago

After upgrading to 0.9.3 i get an error regarding djangocms-cascade.

In my setup I'm not using any cascade plugins so my settings for djangocms-cascade is CMSPLUGIN_CASCADE = {} since it's required to specify.

Traceback (most recent call last):
  File "manage.py", line 14, in <module>
    execute_from_command_line(sys.argv)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate
    app_config.ready()
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/contrib/admin/apps.py", line 22, in ready
    self.module.autodiscover()
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
    autodiscover_modules('admin', register_to=site)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cms/admin/__init__.py", line 11, in <module>
    plugin_pool.plugin_pool.discover_plugins()
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cms/plugin_pool.py", line 32, in discover_plugins
    load('cms_plugins')
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cms/utils/django_load.py", line 57, in load
    get_module(app, modname, verbose, failfast)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cms/utils/django_load.py", line 41, in get_module
    module = import_module(module_name)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cmsplugin_cascade/cms_plugins.py", line 23, in <module>
    import_module('{}.cms_plugins'.format(module))
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cmsplugin_cascade/generic/cms_plugins.py", line 160, in <module>
    class FontIconPlugin(CascadePluginBase):
  File "/Users/dino/.virtualenvs/gibi-trieste.com/lib/python2.7/site-packages/cmsplugin_cascade/plugin_base.py", line 125, in __new__
    attrs['fields'] += (('save_shared_glossary', 'save_as_identifier'), 'shared_glossary',)
KeyError: u'fields'
jrief commented 7 years ago

could you please send me a dump with the contents of local variables. It can be enabled in your settings.py. Look here for details http://stackoverflow.com/questions/15571499/including-local-variables-in-django-error-emails

btw, if you are on @DjangoUnderHood we can meet directly.

dinoperovic commented 7 years ago

I'm unable to start the server, this traceback is from the console when I try to start the server.

I almost did attend @DjangoUnderHood, but unfortunately won't make it.

dinoperovic commented 7 years ago

I managed to get around the error by commenting out the FontIconPlugin part in djangocms-cascade settings.py.

if 'cmsplugin_cascade.sharable' in settings.INSTALLED_APPS:
    CMSPLUGIN_CASCADE.setdefault('plugins_with_sharables', {})
else:
    CMSPLUGIN_CASCADE['plugins_with_sharables'] = {
        # 'FontIconPlugin': ('font-size', 'color', 'text-align', 'border', 'border-radius'),
    }

Now I get another error trying to migrate the db:

CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0014_glossary_field, 0014_auto_20161026_1238 in cmsplugin_cascade).
To fix them run 'python manage.py makemigrations --merge'
dinoperovic commented 7 years ago

So running python manage.py makemigrations --merge did create a new cmsplugin_cascade.0015_merge for djangocms-cascade, and now I'm able to migrate.

The issue with default sharable is solved for me by adding cmsplugin_cascade.sharable to INSTALLED_APPS so that FontIconPlugin is not set by default.

jrief commented 7 years ago

Ups sorry for that. * FontIconPlugin* is still experimental, so it should not interfere with django-SHOP. Could you please create a pull request for it.