django-polymorphic / django-polymorphic-tree

Polymorphic MPTT tree support for models
Other
170 stars 45 forks source link

Update models.py #66

Closed bashu closed 6 years ago

bashu commented 6 years ago

better exception handling, ref https://github.com/django-fluent/django-fluent-pages/issues/132

codecov[bot] commented 6 years ago

Codecov Report

Merging #66 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #66   +/-   ##
=======================================
  Coverage   64.98%   64.98%           
=======================================
  Files          12       12           
  Lines         794      794           
=======================================
  Hits          516      516           
  Misses        278      278
Impacted Files Coverage Δ
polymorphic_tree/models.py 63.79% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 736a804...dd10473. Read the comment docs.

vdboor commented 6 years ago

I think this code should handle can_have_children instead. The reason it crashes in fluent-pages, is because the TextFile has can_have_children=False and this code looks for the child-types for a node that can't have children.

bashu commented 6 years ago

@vdboor I agree, but when we can see minor bugfix release?

vdboor commented 6 years ago

@bashu v1.5 is out, with Django 2.0 support too!

I noticed that 1.4.2 accidentally dropped support for older Django versions (1.6, 1,7, 1.9). I didn't notice that commit when I released a fix for django-polymorphic 2.0. Maybe that also caused your compatibility errors with polymorphic vs fluent-pages