kopia lustrzana https://github.com/wagtail/wagtail
Fix crash when sort_order is None
rodzic
e39b0879d3
commit
83d17cab5e
|
@ -294,7 +294,9 @@ class ChildObjectComparison:
|
|||
indicates the object moved up one space.
|
||||
"""
|
||||
if not self.is_addition() and not self.is_deletion():
|
||||
return getattr(self.obj_b, 'sort_order', 0) - getattr(self.obj_a, 'sort_order', 0)
|
||||
sort_a = getattr(self.obj_a, 'sort_order', 0) or 0
|
||||
sort_b = getattr(self.obj_b, 'sort_order', 0) or 0
|
||||
return sort_b - sort_a
|
||||
|
||||
def get_field_comparisons(self):
|
||||
"""
|
||||
|
|
Ładowanie…
Reference in New Issue