Skip to content

Commit

Permalink
Merge pull request #11545 from rtibbles/safety_first
Browse files Browse the repository at this point in the history
Handle weird edge case where the extra_settings key does not exist yet.
  • Loading branch information
bjester authored Nov 20, 2023
2 parents 6986711 + 943c551 commit 7168ca1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kolibri/core/device/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 7168ca1

Please sign in to comment.