From 9ba5464bc9fb54c1d9b1c776656eff378ffd227d Mon Sep 17 00:00:00 2001 From: Son Date: Fri, 20 May 2022 17:59:41 +0200 Subject: [PATCH] allow to create reverse alias for NOREPLY --- app/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models.py b/app/models.py index 9b89b9ca..945b2d4c 100644 --- a/app/models.py +++ b/app/models.py @@ -36,6 +36,7 @@ from app.config import ( MAX_NB_SUBDOMAIN, MAX_NB_DIRECTORY, ROOT_DIR, + NOREPLY, ) from app.db import Session from app.errors import ( @@ -1648,9 +1649,10 @@ class Contact(Base, ModelMixin): website_email = sanitize_email(website_email) # make sure contact.website_email isn't a reverse alias - orig_contact = Contact.get_by(reply_email=website_email) - if orig_contact: - raise CannotCreateContactForReverseAlias(str(orig_contact)) + if website_email != NOREPLY: + orig_contact = Contact.get_by(reply_email=website_email) + if orig_contact: + raise CannotCreateContactForReverseAlias(str(orig_contact)) Session.add(new_contact)