diff options
author | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-04-20 17:09:43 -0300 |
---|---|---|
committer | Ivan Alejandro <ivanalejandro0@gmail.com> | 2015-08-24 16:30:57 -0300 |
commit | 9a21cc06cfc4024c881b4ba59c10c69e7de90fe9 (patch) | |
tree | 972a18592cac71c220eed34515591fbe0d0bee54 /src/leap/bitmask/config/providerconfig.py | |
parent | 182dd2738f077079a47d3f56033b78dac9204986 (diff) |
[bug] handle disabled registration, error 403.
If the user wants to register a new account we check whether the
provider allows registration or not right after getting the
provider.json file and show an error msg on the wizard if not allowed.
Also, there is a new signal to handle the error raised by the server if
a registration attempt is made but is rejected with error 403.
- Resolves: #6594
Diffstat (limited to 'src/leap/bitmask/config/providerconfig.py')
-rw-r--r-- | src/leap/bitmask/config/providerconfig.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/leap/bitmask/config/providerconfig.py b/src/leap/bitmask/config/providerconfig.py index f454bb40..d972b280 100644 --- a/src/leap/bitmask/config/providerconfig.py +++ b/src/leap/bitmask/config/providerconfig.py @@ -69,6 +69,7 @@ class ProviderConfig(BaseConfig): details["description"] = config.get_description(lang=lang) details["enrollment_policy"] = config.get_enrollment_policy() details["services"] = config.get_services() + details["allow_registration"] = config.get_allow_registration() services = [] for service in config.get_services(): @@ -177,6 +178,15 @@ class ProviderConfig(BaseConfig): services = self._safe_get_value("services") return services + def get_allow_registration(self): + """ + Return whether the registration is allowed or not in the provider. + + :rtype: bool + """ + service = self._safe_get_value("service") + return service['allow_registration'] + def get_ca_cert_path(self, about_to_download=False): """ Returns the path to the certificate for the current provider. |