Add default domain to API response

This commit is contained in:
Salamandar 2020-06-21 14:15:46 +02:00
parent c473902776
commit 1ff3c1cd07

View file

@ -61,7 +61,11 @@ def domain_list(exclude_subdomains=False):
continue
result_list.append(domain)
return {'domains': result_list}
result_list.sort()
return {
'domains': result_list,
'default': result_list.index(_get_maindomain())
}
@is_unit_operation()
@ -89,7 +93,7 @@ def domain_add(operation_logger, domain, dyndns=False):
raise YunohostError('domain_exists')
operation_logger.start()
# Lower domain to avoid some edge cases issues
# See: https://forum.yunohost.org/t/invalid-domain-causes-diagnosis-web-to-fail-fr-on-demand/11765
domain = domain.lower()