fix POST /v2/alias/custom/new when DISABLE_ALIAS_SUFFIX is set

This commit is contained in:
Son NK 2020-06-15 23:35:20 +02:00
parent 6f820c5fc5
commit ee6a1a672d

View file

@ -170,7 +170,8 @@ def new_custom_alias_v2():
LOG.d(f"Alias {full_alias} is currently in the {domain.domain} trash. ")
return jsonify(error=f"alias {full_alias} in domain trash"), 409
custom_domain_id = domain.id
if domain:
custom_domain_id = domain.id
alias = Alias.create(
user_id=user.id,