From 943c5517e95cd8e77c8300fe3a64e849fd2be137 Mon Sep 17 00:00:00 2001 From: Richard Tibbles Date: Mon, 20 Nov 2023 07:59:06 -0500 Subject: [PATCH] Handle weird edge case where the extra_settings key does not exist yet. --- kolibri/core/device/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kolibri/core/device/models.py b/kolibri/core/device/models.py index ea9aaa92459..d725d08bd7d 100644 --- a/kolibri/core/device/models.py +++ b/kolibri/core/device/models.py @@ -192,7 +192,10 @@ def _get_extra(self, name): :param name: A str name of the `extra_settings` field :return: mixed """ - return self.extra_settings.get(name, extra_settings_default_values[name]) + try: + return self.extra_settings.get(name, extra_settings_default_values[name]) + except KeyError: + return extra_settings_default_values[name] @property def allow_download_on_metered_connection(self):