New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: 'NoneType' object has no attribute 'is_descendant_of' #5885
Comments
Hello, |
Unfortunately, the result is the same even using the installer. |
I have found that the problem is with postgres ordering of varchars. |
So the solution was following: |
Hello @misli, |
Well, it took me some time, but I have finally found it. As I have written in the previous comment, the collation matters. You haven't encountered this issue, as You probably use
It is not wrong. I want all the names, titles, etc. to be sorted correctly ( |
@evildmp We need to add a note that says the cms should be used with no collation. On postgres this is |
@misli Just checked django-treebeard's issue tracker, but couldn't find any issue on that. Could you please explain your issue there again. |
This "incorrect" collation can also result in "IntegrityError: duplicate key value violates unique constraint "cms_cmsplugin_path_7692c19a7d5df9d5_uniq"" errors because the django-treebeard's get_root_nodes() returns the nodes in wrong order. This error happened when trying to publish pages. Fixed it by setting the collation to "C" on the "path" column. Not sure if it would be necessary to use "C" collation in all cms tables? Weirdly this error was only experienced in Azure PostgreSQL but not in my local dev (MacOS), even though in both cases the database was using seemingly the same collation (fi_FI with UTF-8 encoding). Maybe django-treebeard/django-cms should use this PR #django-treebeard/django-treebeard#143 ? |
I have run into this issue and changed the command from @misli to fix the issue. Followingly:
|
I know, that similar issue was marked as solved few months ago, but I am experiencing this issue now again when using postgres.
Summary
I always get unhandled exeption when creating subpage or when moving some page under another one. It only happens with postgres.
Steps to reproduce
Environment
The text was updated successfully, but these errors were encountered: