misc: don't crash on missing language code (#21252)
This happens with the "check" management command.
This commit is contained in:
parent
eb070bfc8d
commit
61193bc82d
|
@ -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
|
||||
|
|
Reference in New Issue