Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Goodbye page, style fixes

Pacu23aab43678c97
diff --git a/saleor/account/views.py b/saleor/account/views.py
index e4bc1fc1f6..f68855299a 100755
--- a/saleor/account/views.py
+++ b/saleor/account/views.py
@@ -131,11 +131,9 @@ def address_delete(request, pk):
@require_POST
def account_delete(request, pk):
user = get_object_or_404(User, pk=pk)
- import pdb; pdb.set_trace()
-
if request.user.pk != user.pk:
raise Http404('No such page!')
- send_account_delete_confirmation_email.delay(user.token, user.email)
+ send_account_delete_confirmation_email.delay(str(user.token), user.email)
messages.success(
request, pgettext(
'Storefront message, when user requested his account removed',
@@ -145,6 +143,6 @@ def account_delete(request, pk):
def account_delete_confirm(request, token):
user = get_object_or_404(User, token=token)
- # user.delete()
+ user.delete()
return TemplateResponse(
- request, 'account/account_delete_confirm.html', {'user': user})
+ request, 'account/account_delete.html')
diff --git a/saleor/static/scss/layouts/_account.scss b/saleor/static/scss/layouts/_account.scss
index 8b28286f7e..e367425153 100644
--- a/saleor/static/scss/layouts/_account.scss
+++ b/saleor/static/scss/layouts/_account.scss
@@ -44,4 +44,16 @@
h3 {
font-size: 1rem;
}
+
+ &__deleted {
+ text-align: center;
+ margin-top: $global-margin * 6;
+ @include media-breakpoint-down(sm) {
+ margin-top: $global-margin * 3;
+ }
+ h1 {
+ font-weight: 300;
+ margin-top: -$global-margin * 0.5;
+ }
+ }
}
diff --git a/templates/account/account_delete.html b/templates/account/account_delete.html
new file mode 100644
index 0000000000..e8801c504f
--- /dev/null
+++ b/templates/account/account_delete.html
@@ -0,0 +1,27 @@
+{% extends 'base.html' %}
+
+{% load bootstrap_form from bootstrap4 %}
+{% load staticfiles %}
+{% load i18n %}
+{% load placeholder %}
+
+{% block title %}{% trans "Thank you" context "Checkout success page title" %} — {{ block.super }}{% endblock %}
+
+
+
+
+{% block content %}
+<div class="row account__deleted">
+ <div class="col-xl-10 m-auto">
+ <img class="lazyload lazypreload"
+ data-src="{% static 'images/login-bg.png' %}"
+ data-srcset="{% static 'images/login-bg.png' %} 1x, {% static 'images/login-bg2x.png' %} 2x">
+ <h1>{% trans "Sorry to see you go!" context "Message displayed to the user after his account was deleted" %}</h1>
+ <p>{% blocktrans trimmed context "Message displayed to the user after his account was deleted" %}
+ Your account was deleted successfully.
+ If any problems or questions contact us.
+ {% endblocktrans %}
+ </p>
+ </div>
+</div>
+{% endblock %}
diff --git a/tests/test_account.py b/tests/test_account.py
index 3f5adf629d..766ed6cb94 100644
--- a/tests/test_account.py
+++ b/tests/test_account.py
@@ -16,6 +16,7 @@ from django.urls import reverse
from django_countries.fields import Country
from saleor.account import forms, i18n
from saleor.account.forms import FormWithReCaptcha
+from saleor.account.models import User
from saleor.account.templatetags.i18n_address_tags import format_address
from saleor.account.validators import validate_possible_number
@@ -280,7 +281,7 @@ def test_view_account_delete(
response = authorized_client.post(url)
assert response.status_code == 302
send_confirmation_mock.assert_called_once_with(
- customer_user.token, customer_user.email)
+ str(customer_user.token), customer_user.email)
def test_view_account_delete_confirm(customer_user, authorized_client):
@@ -292,5 +293,5 @@ def test_view_account_delete_confirm(customer_user, authorized_client):
url = reverse('account:delete-confirm', args=[customer_user.token])
response = authorized_client.get(url)
assert response.status_code == 200
- customer_user.refresh_from_db()
+ customer_user = User.objects.filter(pk=customer_user.pk).first()
assert customer_user is None