Prevent signups with accounts where an alias exists

master
Florent Daigniere 2 years ago
parent d0113800fe
commit 30b3a3771e

@ -167,7 +167,7 @@ def user_signup(domain_name=None):
form = forms.UserSignupFormCaptcha() form = forms.UserSignupFormCaptcha()
if form.validate_on_submit(): if form.validate_on_submit():
if domain.has_email(form.localpart.data): if domain.has_email(form.localpart.data) or models.Alias.resolve(form.localpart.data, domain_name):
flask.flash('Email is already used', 'error') flask.flash('Email is already used', 'error')
else: else:
flask.session.regenerate() flask.session.regenerate()

@ -0,0 +1 @@
Prevent signups with accounts for which an SQL-LIKE alias exists.
Loading…
Cancel
Save