From 539bf56e97033f9e8a197c44c630619d82839e36 Mon Sep 17 00:00:00 2001 From: Son NK Date: Wed, 22 Jan 2020 23:03:52 +0100 Subject: [PATCH] improve custom alias check --- app/dashboard/views/custom_alias.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/dashboard/views/custom_alias.py b/app/dashboard/views/custom_alias.py index 984b1cd7..e865c47b 100644 --- a/app/dashboard/views/custom_alias.py +++ b/app/dashboard/views/custom_alias.py @@ -72,10 +72,11 @@ def custom_alias(): def verify_prefix_suffix(user, alias_prefix, alias_suffix, user_custom_domains) -> bool: """verify if user could create an alias with the given prefix and suffix""" + if not alias_prefix or not alias_suffix: # should be caught on frontend + return False + alias_prefix = alias_prefix.strip() alias_prefix = convert_to_id(alias_prefix) - if not alias_prefix: # should be caught on frontend - return False # make sure alias_suffix is either .random_word@simplelogin.co or @my-domain.com alias_suffix = alias_suffix.strip()