Django 2.1 support
See original GitHub issue[Spawning off #18]
There seems to be an odd bug in django-mptt
(or in the way Hordak is using django-mptt
) that is preventing the account tree updating correctly in Django >= 2.1. I’ve therefore only marked Django < 2.1 as supported.
Travis is is testing on Django 2.1, but with failures allowed. The problematic test is hordak.tests.models.test_core.AccountTestCase.test_full_code_changes_on_update
. It seems that the accounts tree is not having it’s left/right values set correctly, and therefore the PG trigger which recalculates the Account’s full_code
makes a mistake.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Django 2.1 release notes
Django 2.1 supports Python 3.5, 3.6, and 3.7. Django 2.0 is the last version to support Python 3.4. We highly recommend and only...
Read more >Django - endoflife.date
Check End of Life, Support Schedule, and release timelines for AlmaLinux OS, Alpine Linux, Amazon Linux, Android OS, Angular, Ansible-core, Ansible, antiX, ...
Read more >Django - PyPI
Supporting the Development of Django. Django's development depends on your contributions. If you depend on Django, remember to support the Django Software ...
Read more >Django 2.1 support · Issue #220 - GitHub
I have this working with Django 2.1. Make sure you have 100% followed these instructions for setting up your celery beat worker.
Read more >How to upgrade Django to a newer version
For each feature release, use the latest patch release (e.g. for 2.1, use 2.1.15). ... some of your dependencies may not yet support...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I got it. Tests passing.
Whenever a new account is inserted, mptt adjusts the lft and rght values of (possibly many) other accounts as part of its duty to maintain a valid tree. This mass database update leaves the affected in memory account objects with outdated and invalid tree information. Should any of these objects be used to save new data, the invalid tree data is inadvertently saved along with it thus corrupting the tree. Maths is not my strong point so I would err on the side of caution and assume that whenever a new account is inserted, all in memory objects hold invalid data. Seeing as we don’t actually need this tree data, I think it would be optimal to never load it in the first place but I haven’t found a way to avoid this. What I have found is a way to prevent the saving of it. The save() method accepts a keyword argument ‘update_fields’ which allows you to provide a list of fields to update while ignoring the others:
What I do not understand is how it worked up until django<2.1 - but thats of little concern now.
Hope it checks out with you and hope to see a django 2.1.2 compatible release sometime soon.
Closed by #42. Released in
1.9.0
.