mirror of
https://github.com/simple-login/app.git
synced 2024-09-27 20:31:30 +02:00
sanitize mailbox before creating: remove empty space
This commit is contained in:
parent
5f8fff5af3
commit
d81ad2fd12
@ -30,7 +30,7 @@ def create_mailbox():
|
||||
|
||||
"""
|
||||
user = g.user
|
||||
mailbox_email = request.get_json().get("email").lower().strip()
|
||||
mailbox_email = request.get_json().get("email").lower().strip().replace(" ", "")
|
||||
|
||||
if mailbox_already_used(mailbox_email, user):
|
||||
return jsonify(error=f"{mailbox_email} already used"), 400
|
||||
|
@ -82,7 +82,9 @@ def mailbox_route():
|
||||
return redirect(url_for("dashboard.mailbox_route"))
|
||||
|
||||
if new_mailbox_form.validate():
|
||||
mailbox_email = new_mailbox_form.email.data.lower().strip()
|
||||
mailbox_email = (
|
||||
new_mailbox_form.email.data.lower().strip().replace(" ", "")
|
||||
)
|
||||
|
||||
if mailbox_already_used(mailbox_email, current_user):
|
||||
flash(f"{mailbox_email} already used", "error")
|
||||
|
Loading…
Reference in New Issue
Block a user