Open Kane1994 opened 4 years ago
This bug only seems to happen when attempting to turn a page offline via the page list view. It works fine when turning the page offline in the page detail view.
This happens when unpublishing a Plain Content page, which has the following model:
class PlainContent(ProjectContentBase): kicker = models.CharField( max_length=50, blank=True, null=True, ) content_title = models.CharField( max_length=140, blank=True, null=True, ) content = HtmlField( blank=True, null=True, ) sidebar_blocks = JetSortedManyToManyField( 'site.SidebarBlock', blank=True, ) def __str__(self): return self.page.title`
It throws KeyError: 'sidebar_blocks' on this specific code:
KeyError: 'sidebar_blocks'
for field in content_obj._meta.many_to_many: getattr(content_obj, field.name).set(form.cleaned_data[field.name])
Which can be found online 345 on cms/apps/pages/admin.py
cms/apps/pages/admin.py
This bug only seems to happen when attempting to turn a page offline via the page list view. It works fine when turning the page offline in the page detail view.
This happens when unpublishing a Plain Content page, which has the following model:
It throws
KeyError: 'sidebar_blocks'
on this specific code:for field in content_obj._meta.many_to_many: getattr(content_obj, field.name).set(form.cleaned_data[field.name])
Which can be found online 345 on
cms/apps/pages/admin.py