summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@entrouvert.com>2019-02-20 10:05:10 (GMT)
committerFrédéric Péters <fpeters@entrouvert.com>2019-02-20 10:05:17 (GMT)
commit61193bc82d695f59b3b6422e97353fb808b61e58 (patch)
treeeeb8622e95492eb24354d14c3c4ca6f4f805564b
parenteb070bfc8d0312a0196df210dec36ce18eacfb65 (diff)
downloadcorbo-61193bc82d695f59b3b6422e97353fb808b61e58.zip
corbo-61193bc82d695f59b3b6422e97353fb808b61e58.tar.gz
corbo-61193bc82d695f59b3b6422e97353fb808b61e58.tar.bz2
misc: don't crash on missing language code (#21252)v0.18
This happens with the "check" management command.
-rw-r--r--corbo/widgets.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/corbo/widgets.py b/corbo/widgets.py
index 85ba234..dc541dd 100644
--- a/corbo/widgets.py
+++ b/corbo/widgets.py
@@ -70,7 +70,8 @@ class PickerWidgetMixin(object):
attrs = {'readonly': ''}
self.options = options
- self.options['language'] = get_language().split('-')[0]
+ if get_language():
+ self.options['language'] = get_language().split('-')[0]
# We're not doing localisation, get the Javascript date format provided by the user,
# with a default, and convert it to a Python data format for later string parsing