misc: don't crash on missing language code (#21252)

This commit is contained in:
Frédéric Péters 2018-01-18 11:21:07 +01:00
parent c932aea280
commit a1dc28536a
1 changed files with 2 additions and 1 deletions

View File

@ -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