mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-08-26 12:46:08 +00:00
nextcloud: Don't show incorrect phone region when it is not set
Tests: - Install nextcloud and notice that the default phone region is 'Not set'. Select phone region, it sets properly. Set it to 'Not set' and that works too. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
138cdd6e3f
commit
722da5b0d5
@ -11,9 +11,12 @@ def _get_phone_regions():
|
|||||||
from iso3166 import countries # type: ignore
|
from iso3166 import countries # type: ignore
|
||||||
phone_regions = [(country.alpha2, country.name)
|
phone_regions = [(country.alpha2, country.name)
|
||||||
for country in countries]
|
for country in countries]
|
||||||
return sorted(phone_regions)
|
phone_regions = sorted(phone_regions)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
return [('US', 'United States of America')]
|
# Allow users to set a non-empty value
|
||||||
|
phone_regions = [('US', 'United States of America')]
|
||||||
|
|
||||||
|
return [('', _('Not set'))] + phone_regions
|
||||||
|
|
||||||
|
|
||||||
class NextcloudForm(forms.Form):
|
class NextcloudForm(forms.Form):
|
||||||
|
|||||||
@ -25,7 +25,7 @@ class NextcloudAppView(AppView):
|
|||||||
initial = super().get_initial()
|
initial = super().get_initial()
|
||||||
initial.update({
|
initial.update({
|
||||||
'domain': privileged.get_domain(),
|
'domain': privileged.get_domain(),
|
||||||
'default_phone_region': privileged.get_default_phone_region()
|
'default_phone_region': privileged.get_default_phone_region() or ''
|
||||||
})
|
})
|
||||||
return initial
|
return initial
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user