FIX: Patch for choices being none

Honestly no idea if this is going to work, I can't reproduce the issue locally...
This commit is contained in:
2020-03-07 16:47:30 +00:00
parent 8568c591a9
commit 02d40d1b39

View File

@@ -25,7 +25,7 @@ class FieldComparison(object):
self._new = new
def display_value(self, value):
if isinstance(self.field, IntegerField) and len(self.field.choices) > 0:
if isinstance(self.field, IntegerField) and self.field.choices is not None and len(self.field.choices) > 0:
return [x[1] for x in self.field.choices if x[0] == value][0]
if self.field.name == "risk_assessment_edit_url":
return "completed" if value else ""