handle the case where no hostname is provided in /api/alias/new

This commit is contained in:
Son NK 2019-12-01 23:41:15 +00:00
parent 9296fd42c4
commit 79a7985221
1 changed files with 5 additions and 0 deletions

View File

@ -54,6 +54,11 @@ def index():
if user.is_premium():
LOG.d("create new custom alias %s %s", hostname, user)
# avoid too short custom email prefix
if len(hostname) < 3:
LOG.d("hostname %s too short", hostname)
hostname = "default"
# generate a custom email
found = False
while not found: