diff --git a/plinth/modules/nextcloud/forms.py b/plinth/modules/nextcloud/forms.py index 1d32ccaf3..731ac25ec 100644 --- a/plinth/modules/nextcloud/forms.py +++ b/plinth/modules/nextcloud/forms.py @@ -11,9 +11,12 @@ def _get_phone_regions(): from iso3166 import countries # type: ignore phone_regions = [(country.alpha2, country.name) for country in countries] - return sorted(phone_regions) + phone_regions = sorted(phone_regions) 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): diff --git a/plinth/modules/nextcloud/views.py b/plinth/modules/nextcloud/views.py index 3eb01240d..92a1e21f6 100644 --- a/plinth/modules/nextcloud/views.py +++ b/plinth/modules/nextcloud/views.py @@ -25,7 +25,7 @@ class NextcloudAppView(AppView): initial = super().get_initial() initial.update({ 'domain': privileged.get_domain(), - 'default_phone_region': privileged.get_default_phone_region() + 'default_phone_region': privileged.get_default_phone_region() or '' }) return initial