Fixed exception handling in 'is_sortable' classmethod
This commit is contained in:
1 parent
04bdb80637
commit
13af5f8142
1 file changed
+1
-1
@@ -42,7 +42,7 @@ class Sortable(models.Model):
|
|||||||
def is_sortable(cls):
|
def is_sortable(cls):
|
||||||
try:
|
try:
|
||||||
max_order = cls.objects.aggregate(models.Max('order'))['order__max']
|
max_order = cls.objects.aggregate(models.Max('order'))['order__max']
|
||||||
except TypeError, IndexError:
|
except (TypeError, IndexError):
|
||||||
max_order = 0
|
max_order = 0
|
||||||
return True if max_order > 1 else False
|
return True if max_order > 1 else False
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user