69.2. Checkout overriding same accounts
Checkout overriding
if not request.user.is_authenticated :
email = data.get("email")
try :
validate_email(email)
except ValidationError :
error = "email"
clients = Client.objects.filter(email=email)
if clients.exists() and clients[0].user != None:
# If a client with the same email exists, return an error
error = "email_in_use"{% if error == "email" %}
<p class="checkout_erro">Fill in your email to continue.</p>
{% endif %}
{% if error == "email_in_use" %}
<p class="checkout_erro">Account with that email already exists. Log in or use another.</p>
{% endif %}Last updated