mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
datetime: Show timezone properly when it not in expected list
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
parent
6f14f20ef1
commit
520347cc1b
@ -44,8 +44,11 @@ This will set the system-wide time zone.'))
|
||||
time_zone_options = [(zone, zone)
|
||||
for zone in self.get_time_zones()]
|
||||
# Show not-set option only when time zone is not set
|
||||
if self.initial.get('time_zone') == 'none':
|
||||
current_time_zone = self.initial.get('time_zone')
|
||||
if current_time_zone == 'none':
|
||||
time_zone_options.insert(0, ('none', _('-- no time zone set --')))
|
||||
elif (current_time_zone, current_time_zone) not in time_zone_options:
|
||||
time_zone_options.insert(0, (current_time_zone, current_time_zone))
|
||||
|
||||
self.fields['time_zone'].choices = time_zone_options
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user