jrief / djangocms-cascade

Build Single Page Applications using the Django-CMS plugin system
MIT License
166 stars 85 forks source link

Django==1.8, CMS==3.1.1, Cascade==0.5.0: KeyError on adding a BootstrapRowPlugin to a Container #84

Closed aa-dit-yuh closed 9 years ago

aa-dit-yuh commented 9 years ago

Traceback:

Internal Server Error: /admin/cms/page/edit-plugin/16/
Traceback (most recent call last):
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 233, in inner
    return view(request, *args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/cms/admin/pageadmin.py", line 1429, in edit_plugin
    return super(PageAdmin, self).edit_plugin(*args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/views/decorators/clickjacking.py", line 41, in wrapped_view
    resp = view_func(*args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/cms/admin/placeholderadmin.py", line 376, in edit_plugin
    response = plugin_admin.add_view(request)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1516, in add_view
    return self.changeform_view(request, None, form_url, extra_context)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 34, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 30, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/utils/decorators.py", line 145, in inner
    return func(*args, **kwargs)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1467, in changeform_view
    self.save_model(request, new_object, form, not add)
  File "/home/aditya/robotix/Robotix/.virtualenv/lib/python2.7/site-packages/cmsplugin_cascade/bootstrap3/container.py", line 147, in save_model
    narrowest = parent_glossary['breakpoints'][0]
KeyError: u'breakpoints'

My settings file has the following configurations:

# Django CMS Cascade Configuration
# ------------------------------------------------------------------------------
CMSPLUGIN_CASCADE_PLUGINS = [
    'cmsplugin_cascade.bootstrap3',
    'cmsplugin_cascade.link',
]
CMSPLUGIN_CASCADE_WITH_SHARABLES = {
    'TextLinkPlugin':  ('link',),
    'BootstrapButtonPlugin': ('link',),
}
CMSPLUGIN_CASCADE_WITH_EXTRAFIELDS = (
    'BootstrapButtonPlugin',
    'BootstrapRowPlugin',
    'SimpleWrapperPlugin',
    'PanelGroupPlugin',
    'PanelPlugin',
    'BootstrapImagePlugin',
)
CMSPLUGIN_CASCADE_ALIEN_PLUGINS = ('TextPlugin',)

COLUMN_GLOSSARY = {
    'breakpoints': ['xs', 'sm', 'md', 'lg'],
    'container_max_widths': {'xs': 750, 'sm': 750, 'md': 970, 'lg': 1170},
    'fluid': False,
    'media_queries': {
        'xs': ['(max-width: 768px)'],
        'sm': ['(min-width: 768px)', '(max-width: 992px)'],
        'md': ['(min-width: 992px)', '(max-width: 1200px)'],
        'lg': ['(min-width: 1200px)'],
    },
}

CMS_PLACEHOLDER_CONF = {
    'Bootstrap Column': {
        'plugins': ['BootstrapRowPlugin', 'TextPlugin'],
        'parent_classes': {'BootstrapRowPlugin': []},
        'require_parent': False,
        'glossary': COLUMN_GLOSSARY,
    },
}

Is this error related to Django 1.8 or is there something which I have missed in my settings.py. Thank you.

jrief commented 9 years ago

Did you try with Django-1.7 using the supplied example?

Due to lack of time, currently I'm not able to test with Django-1.8.

jrief commented 9 years ago

Can this be closed now?

aa-dit-yuh commented 9 years ago

@jrief Please let me gather a few more information. I was busy working on PRs.
I will get back to you on this issue soon.

aa-dit-yuh commented 9 years ago

@jrief I cannot reproduce the issue on master branch. The issue can be closed. Thank you.