From c73820920bec6041b9cbae5ed5a2c03c42d77ded Mon Sep 17 00:00:00 2001 From: Son NK <> Date: Sat, 23 May 2020 19:35:18 +0200 Subject: [PATCH] check DomainDeletedAlias when creating new alias --- app/models.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models.py b/app/models.py index 7e8bf6e5..20d1be84 100644 --- a/app/models.py +++ b/app/models.py @@ -701,6 +701,9 @@ class Alias(db.Model, ModelMixin): if DeletedAlias.get_by(email=email): raise AliasInTrashError + if DomainDeletedAlias.get_by(email=email, user_id=kw["user_id"]): + raise AliasInTrashError + db.session.add(r) return r