show error when a domain can't be used as random alias default domain

This commit is contained in:
Son 2022-01-03 10:05:06 +01:00
parent 08c7aa8b98
commit 85fb859dcb

View file

@ -210,9 +210,11 @@ def setting():
custom_domain.user_id != current_user.id
or not custom_domain.verified
):
LOG.e(
"%s cannot use domain %s", current_user, default_domain
LOG.w(
"%s cannot use domain %s", current_user, custom_domain
)
flash(f"Domain {default_domain} can't be used", "error")
return redirect(request.url)
else:
current_user.default_alias_custom_domain_id = (
custom_domain.id