Catch for null value for settings choices

This commit is contained in:
Oliver 2021-11-09 22:37:50 +11:00
parent 8d7b73e2a8
commit e303b5a39b

View File

@ -34,11 +34,14 @@ class SettingsSerializer(InvenTreeModelSerializer):
results = []
for choice in obj.choices():
results.append({
'value': choice[0],
'display_name': choice[1],
})
choices = obj.choices()
if choices:
for choice in choices:
results.append({
'value': choice[0],
'display_name': choice[1],
})
return results