mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
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:
@@ -25,7 +25,7 @@ class FieldComparison(object):
|
|||||||
self._new = new
|
self._new = new
|
||||||
|
|
||||||
def display_value(self, value):
|
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]
|
return [x[1] for x in self.field.choices if x[0] == value][0]
|
||||||
if self.field.name == "risk_assessment_edit_url":
|
if self.field.name == "risk_assessment_edit_url":
|
||||||
return "completed" if value else ""
|
return "completed" if value else ""
|
||||||
|
|||||||
Reference in New Issue
Block a user