Merge pull request #1022 from Salamandar/stretch-unstable

Add default domain to API response
This commit is contained in:
Alexandre Aubin 2020-09-24 17:30:24 +02:00 committed by GitHub
commit eceb0aeca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -62,7 +62,6 @@ def domain_list(exclude_subdomains=False):
result_list.append(domain)
def cmp_domain(domain1, domain2):
# Keep the main part of the domain and the extension together
# eg: this.is.an.example.com -> ['example.com', 'an', 'is', 'this']
@ -77,6 +76,11 @@ def domain_list(exclude_subdomains=False):
result_list = sorted(result_list, cmp_domain)
return {'domains': result_list}
return {
'domains': result_list,
'main': _get_maindomain()
}
@is_unit_operation()