1. Kai Diefenbach
  2. django-lfc
  3. Issues
Issue #45 resolved

Deleting portlets and objects behaves strangely.

Maciej Wiśniowski
created an issue

I've created my own portlet that displays subpages for selected Page. Portlet model has ForeignKey to Page.

I've just found that I'm not able to delete Page that is referenced by this portlet.

When I try to delete that page I get database error: {{{


IntegrityError: update or delete on table "lfc_page" violates foreign key constraint "container_id_refs_basecontent_ptr_id_6ba77f17" on table "lfc_commons_templatedtaggedportlet" DETAIL: Key (basecontent_ptr_id)=(5) is still referenced from table "lfc_commons_templatedtaggedportlet". }}}

lfc_commons_templatedtaggedportlet - is table from my portlet

I'm not sure why portlet object is not deleted as Django's delete() should emulate (on delete cascade).

Ok. so I tried to first remove Portlet and then Page.

Portlet has been deleted (at last LFC said that) but I got same error as before when trying to delete Page object.

I've found that while removing portlet (manage/views.py->portlet_delete) only PortletAssignment object is deleted. Portlet itself remains unchanged. I think Portlet object should be deleted too.

Comments (2)

  1. Log in to comment