Fix sort changelist for objects with sortable fk

Loading the test app '/admin/app/project/sort/' changelist failed with
the following error:

UnboundLocalError: local variable 'objects' referenced before assignment

(utils.py, check_model_is_sortable)

See test sample_app test_adminsortable_change_list_view_loads_with_sortable_fk
This commit is contained in:
tomd
2015-01-12 15:40:33 +00:00
parent a64d86a219
commit 7f0519afbe
2 changed files with 12 additions and 2 deletions
+1 -1
View File
@@ -30,5 +30,5 @@ def check_model_is_sortable(cls):
objects = cls.model.objects
else:
objects = cls.objects
return get_is_sortable(objects.all())
return get_is_sortable(objects.all())
return False