Browse Source

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

Son NK 5 years ago
parent
commit
ee6a1a672d
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/api/views/new_custom_alias.py

+ 2 - 1
app/api/views/new_custom_alias.py

@@ -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,