names: Make all apps use new api to retrieve domain names

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2019-08-11 18:39:54 -04:00
1 parent ab42b9b241
commit b684b07d11
10 files changed
+28 -55

No files matched your search

+3 -3
View File
@@ -32,9 +32,9 @@ from plinth.modules import names
def access_info(request, **kwargs):
"""API view to return a list of domains and types."""
domains = [{
'domain': domain,
'type': domain_type
} for domain_type, domains in names.domains.items() for domain in domains]
'domain': domain.name,
'type': domain.domain_type.component_id
} for domain in names.components.DomainName.list()]
response = {'domains': domains}
return HttpResponse(json.dumps(response), content_type='application/json')