django-filer
django-filer copied to clipboard
django_polymorphic: result objects do not have unique primary keys
I'm facing this error when using django-filer along with django_cms:
Error during template rendering
In template /opt/xxx/local/lib/python2.7/site-packages/filer/templates/admin/filer/tools/clipboard/clipboard_item_rows.html, error at line 1
django_polymorphic: result objects do not have unique primary keys - model <class 'filer.models.filemodels.File'>
Database used is postgress
It occurs whenever I try to access a filer related page and only with one single user. Didn't have the chance to dig yet, just filling an issue here if someone already knows better.
Sorry for the delayed response @johnraz. Are you still having this issue? Can you provide more details and package versions (django-filer, django, django_polymorphic)
Hello @stefanfoulis , no worries we all are very busy.
My package versions: Django==1.4.3 django-filer==0.9.1 django-polymorphic==0.2 django-cms==2.3.5 cmsplugin-filer==0.9
The scenario: User is trying to upload a file with cms_plugin. Somehow it fails and from then the user cannot acces the admin at all. This is cause by an assert in django-polymorphic that says that there is a conflict in pk: See: https://github.com/bconstantin/django_polymorphic/blob/master/polymorphic/query.py#L145
I commented, the raise (yea dirty), and everything seems to be ok.
This occured only for one of my customer using firefox for mac ... So as I don't own a mac, I wasn't able to reproduce, just to play with the actual broken database...
Maybe this not unique pk rings any bell ?
I had same problem and solved it by deleting everything from 'filer_clipboarditems' table. Strange thing it had some rows with same 'file_id' value
+1 for clearing out the filer_clipboarditem table fixing this issue. The following query finds the (possibly) offending rows: select file_id, count(file_id) from filer_clipboarditem group by file_id having (count(file_id) > 1);
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This will now be closed due to inactivity, but feel free to reopen it.