From e303b5a39bf87ad73179ec33fd171c4fc411c396 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 9 Nov 2021 22:37:50 +1100 Subject: [PATCH] Catch for null value for settings choices --- InvenTree/common/serializers.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/InvenTree/common/serializers.py b/InvenTree/common/serializers.py index 35a1c79879..4a27e3f30e 100644 --- a/InvenTree/common/serializers.py +++ b/InvenTree/common/serializers.py @@ -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