Use common strings in Azure DevOps config flow (#41974)

This commit is contained in:
Ronaldo Lima authored and GitHub committed 2020-10-17 01:27:44 +02:00
1 parent 74a1b75919
commit 87deb2344c
3 files changed
+9 -9

No files matched your search

@@ -60,14 +60,14 @@ class AzureDevOpsFlowHandler(ConfigFlow, domain=DOMAIN):
if self._pat is not None:
await client.authorize(self._pat, self._organization)
if not client.authorized:
errors["base"] = "authorization_error"
errors["base"] = "invalid_auth"
return errors
project_info = await client.get_project(self._organization, self._project)
if project_info is None:
errors["base"] = "project_error"
return errors
except aiohttp.ClientError:
errors["base"] = "connection_error"
errors["base"] = "cannot_connect"
return errors
return None
@@ -2,8 +2,8 @@
"config": {
"flow_title": "Azure DevOps: {project_url}",
"error": {
"authorization_error": "Authorization error. Check you have access to the project and have the correct credentials.",
"connection_error": "Could not connect to Azure DevOps.",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"project_error": "Could not get project info."
},
"step": {