Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Change urls to account instead of profile
Anna Siwik361c2eb150e8
diff --git a/saleor/account/views.py b/saleor/account/views.pyindex 374b105c09..4d3d361ed2 100755--- a/saleor/account/views.py+++ b/saleor/account/views.py@@ -46,7 +46,7 @@ def address_edit(request, pk):message = pgettext('Storefront message', 'Address successfully updated.')messages.success(request, message)- return HttpResponseRedirect(reverse('profile:details') + '#addresses')+ return HttpResponseRedirect(reverse('account:details') + '#addresses')return TemplateResponse(request, 'account/address_edit.html',{'address_form': address_form})@@ -60,6 +60,6 @@ def address_delete(request, pk):messages.success(request,pgettext('Storefront message', 'Address successfully removed'))- return HttpResponseRedirect(reverse('profile:details') + '#addresses')+ return HttpResponseRedirect(reverse('account:details') + '#addresses')return TemplateResponse(request, 'account/address_delete.html', {'address': address})diff --git a/saleor/checkout/core.py b/saleor/checkout/core.pyindex 97c3d04ed0..b3335c4219 100644--- a/saleor/checkout/core.py+++ b/saleor/checkout/core.py@@ -9,6 +9,8 @@ from django.utils.encoding import smart_textfrom django.utils.translation import get_languagefrom prices import FixedDiscount, Price+from ..account.models import Address+from ..account.utils import store_user_addressfrom ..cart.models import Cartfrom ..cart.utils import get_or_empty_db_cartfrom ..core import analytics@@ -16,8 +18,6 @@ from ..discount.models import NotApplicable, Voucherfrom ..discount.utils import increase_voucher_usagefrom ..order.models import Orderfrom ..shipping.models import ANY_COUNTRY, ShippingMethodCountry-from ..account.models import Address-from ..account.utils import store_user_addressSTORAGE_SESSION_KEY = 'checkout_storage'diff --git a/saleor/core/views.py b/saleor/core/views.pyindex ef3ae0c273..7618831aba 100644--- a/saleor/core/views.py+++ b/saleor/core/views.py@@ -5,9 +5,9 @@ from django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazyfrom impersonate.views import impersonate as orig_impersonate+from ..account.models import Userfrom ..dashboard.views import staff_member_requiredfrom ..product.utils import products_for_homepage, products_with_availability-from ..account.models import Userfrom .utils.schema import get_webpage_schemadiff --git a/saleor/order/models.py b/saleor/order/models.pyindex 5b2df499c9..a8d89fbdb0 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -15,13 +15,13 @@ from payments.models import BasePaymentfrom prices import FixedDiscount, Pricefrom satchless.item import ItemLine, ItemSet-from . import GroupStatus, OrderStatus, emails+from ..account.models import Addressfrom ..core.utils import build_absolute_urifrom ..discount.models import Voucherfrom ..product.models import Product-from ..account.models import Addressfrom .transitions import (cancel_delivery_group, process_delivery_group, ship_delivery_group)+from . import GroupStatus, OrderStatus, emailsclass OrderQuerySet(models.QuerySet):diff --git a/saleor/order/utils.py b/saleor/order/utils.pyindex e664acdc6c..006c8c30ca 100644--- a/saleor/order/utils.py+++ b/saleor/order/utils.py@@ -7,9 +7,9 @@ from django.utils.translation import pgettext_lazyfrom prices import Pricefrom satchless.item import InsufficientStock-from . import GroupStatus-from ..product.utils import allocate_stockfrom ..account.utils import store_user_address+from ..product.utils import allocate_stock+from . import GroupStatusdef check_order_status(func):diff --git a/saleor/order/views.py b/saleor/order/views.pyindex e9cd6d35d3..47b7ea1a9e 100644--- a/saleor/order/views.py+++ b/saleor/order/views.py@@ -10,14 +10,14 @@ from django.template.response import TemplateResponsefrom django.utils.translation import pgettext_lazyfrom payments import PaymentStatus, RedirectNeeded-from . import OrderStatus+from ..account.models import Userfrom ..core.utils import get_client_ipfrom ..registration.forms import LoginForm-from ..account.models import Userfrom .forms import (OrderNoteForm, PasswordForm, PaymentDeleteForm, PaymentMethodsForm)from .models import Order, OrderNote, Paymentfrom .utils import attach_order_to_user, check_order_status+from . import OrderStatuslogger = logging.getLogger(__name__)@@ -182,7 +182,7 @@ def connect_order_with_user(request, token):"We couldn't assign the order to your account as the email"" addresses don't match")messages.warning(request, msg)- return redirect('profile:details')+ return redirect('account:details')attach_order_to_user(order, request.user)msg = pgettext_lazy('storefront message',diff --git a/saleor/search/documents.py b/saleor/search/documents.pyindex 11b64e386b..48c624af2d 100644--- a/saleor/search/documents.py+++ b/saleor/search/documents.py@@ -1,9 +1,9 @@from django_elasticsearch_dsl import DocType, Index, fieldsfrom elasticsearch_dsl import analyzer, token_filter+from ..account.models import Userfrom ..order.models import Orderfrom ..product.models import Product-from ..account.models import Userstorefront = Index('storefront')storefront.settings(number_of_shards=1, number_of_replicas=0)diff --git a/saleor/urls.py b/saleor/urls.pyindex 634a78c409..dda91d0eb9 100644--- a/saleor/urls.py+++ b/saleor/urls.py@@ -6,6 +6,7 @@ from django.contrib.staticfiles.views import servefrom django.views.i18n import JavaScriptCatalogfrom graphene_django.views import GraphQLView+from .account.urls import urlpatterns as account_urlsfrom .cart.urls import urlpatterns as cart_urlsfrom .checkout.urls import urlpatterns as checkout_urlsfrom .core.sitemaps import sitemaps@@ -16,7 +17,6 @@ from .order.urls import urlpatterns as order_urlsfrom .product.urls import urlpatterns as product_urlsfrom .registration.urls import urlpatterns as registration_urlsfrom .search.urls import urlpatterns as search_urls-from .account.urls import urlpatterns as userprofile_urlshandler404 = 'saleor.core.views.handle_404'@@ -33,8 +33,8 @@ urlpatterns = [url(r'^order/', include((order_urls, 'order'), namespace='order')),url(r'^products/',include((product_urls, 'product'), namespace='product')),- url(r'^profile/',- include((userprofile_urls, 'profile'), namespace='profile')),+ url(r'^account/',+ include((account_urls, 'account'), namespace='account')),url(r'^feeds/',include((feed_urls, 'data_feeds'), namespace='data_feeds')),url(r'^search/', include((search_urls, 'search'), namespace='search')),diff --git a/templates/account/address_delete.html b/templates/account/address_delete.htmlindex b7a20c1c4f..9a82cc6e86 100644--- a/templates/account/address_delete.html+++ b/templates/account/address_delete.html@@ -1,6 +1,6 @@{% load i18n %}<div class="address-delete none">- <form method="post" novalidate action="{% url 'profile:address-delete' pk=address.pk %}">+ <form method="post" novalidate action="{% url 'account:address-delete' pk=address.pk %}">{% csrf_token %}<button type="submit" class="btn danger narrow float-right">{% trans "Remove Address" context "Remove address form action" %}diff --git a/templates/account/address_edit.html b/templates/account/address_edit.htmlindex 0266810e06..a0d8129bf7 100644--- a/templates/account/address_edit.html+++ b/templates/account/address_edit.html@@ -17,7 +17,7 @@</a></li><li>- <a href="{% url "profile:details" %}">+ <a href="{% url "account:details" %}">{% trans "Your profile" context "Edit/new address breadcrumb" %}</a></li>diff --git a/templates/account/details.html b/templates/account/details.htmlindex 6ce0763581..20f6b9e77d 100644--- a/templates/account/details.html+++ b/templates/account/details.html@@ -123,7 +123,7 @@{% format_address address %}<ul class="icons"><li>- <a href="{% url "profile:address-edit" pk=address.pk %}">+ <a href="{% url "account:address-edit" pk=address.pk %}">{% trans "Edit" context "User address action" %}</a></li>diff --git a/templates/account/password_change.html b/templates/account/password_change.htmlindex 869fee7229..737cfaf95b 100644--- a/templates/account/password_change.html+++ b/templates/account/password_change.html@@ -5,7 +5,7 @@{% block breadcrumb %}<ul class="breadcrumbs list-unstyled"><li><a href="{% url 'home' %}">{% trans "Home" context "Main navigation item" %}</a></li>- <li><a href="{% url 'profile:details' %}">{% trans "Your account" context "Main navigation item" %}</a></li>+ <li><a href="{% url 'account:details' %}">{% trans "Your account" context "Main navigation item" %}</a></li><li><a href="{% url 'home' %}">{% trans "Edit" context "Password change breadcrumb" %}</a></li></ul>{% endblock breadcrumb %}diff --git a/templates/base.html b/templates/base.htmlindex ab2c34d079..12b3d0c380 100644--- a/templates/base.html+++ b/templates/base.html@@ -56,7 +56,7 @@</li>{% endif %}<li>- <a href="{% url "profile:details" %}">+ <a href="{% url "account:details" %}">{% trans "Your account" context "Main navigation item" %}</a></li>{% if user.is_impersonate %}@@ -214,7 +214,7 @@</li>{% endif %}<li>- <a href="{% url "profile:details" %}">+ <a href="{% url "account:details" %}">{% trans "Your account" context "Main navigation item" %}</a></li>diff --git a/templates/order/details.html b/templates/order/details.htmlindex 02503bdad0..84ece277be 100644--- a/templates/order/details.html+++ b/templates/order/details.html@@ -19,7 +19,7 @@</a></li><li>- <a href="{% url "profile:details" %}">+ <a href="{% url "account:details" %}">{% trans "Your account" context "Main navigation item" %}</a></li>diff --git a/templates/order/payment.html b/templates/order/payment.htmlindex e1674a9b5d..137bf1f1ef 100644--- a/templates/order/payment.html+++ b/templates/order/payment.html@@ -21,7 +21,7 @@</a></li><li>- <a href="{% url "profile:details" %}">+ <a href="{% url "account:details" %}">{% trans "Your account" context "Main navigation item" %}</a></li>diff --git a/templates/styleguide.html b/templates/styleguide.htmlindex 15040e2846..5f98cc77d5 100644--- a/templates/styleguide.html+++ b/templates/styleguide.html@@ -583,7 +583,7 @@</a></li><li>- <a href="{% url "profile:details" %}" contenteditable="true">+ <a href="{% url "account:details" %}" contenteditable="true">Your profile</a></li>diff --git a/tests/conftest.py b/tests/conftest.pyindex 11a0843d0a..027a0c1797 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -11,6 +11,7 @@ from django.utils.encoding import smart_textfrom PIL import Imagefrom prices import Price+from saleor.account.models import Address, Userfrom saleor.cart import utilsfrom saleor.cart.models import Cartfrom saleor.checkout.core import Checkout@@ -23,7 +24,6 @@ from saleor.product.models import (ProductImage, ProductType, ProductVariant, Stock, StockLocation)from saleor.shipping.models import ShippingMethodfrom saleor.site.models import AuthorizationKey, SiteSettings-from saleor.account.models import Address, User@pytest.fixture(autouse=True)diff --git a/tests/dashboard/test_staff.py b/tests/dashboard/test_staff.pyindex 0afeea9d55..5b2d899910 100644--- a/tests/dashboard/test_staff.py+++ b/tests/dashboard/test_staff.py@@ -6,9 +6,9 @@ from django.utils.encoding import force_bytesfrom django.utils.http import urlsafe_base64_encodefrom templated_email import send_templated_mail+from saleor.account.models import Userfrom saleor.dashboard.staff.forms import StaffFormfrom saleor.settings import DEFAULT_FROM_EMAIL-from saleor.account.models import Userdef test_staff_form_not_valid(db):diff --git a/tests/test_checkout.py b/tests/test_checkout.pyindex eb07599b3d..d931d0651a 100644--- a/tests/test_checkout.py+++ b/tests/test_checkout.py@@ -6,11 +6,11 @@ from django.contrib.auth.models import AnonymousUserfrom prices import Pricefrom satchless.item import InsufficientStock+from saleor.account.models import Addressfrom saleor.checkout import viewsfrom saleor.checkout.core import STORAGE_SESSION_KEY, Checkoutfrom saleor.checkout.forms import NoteFormfrom saleor.shipping.models import ShippingMethodCountry-from saleor.account.models import Addressdef test_checkout_version():diff --git a/tests/test_core.py b/tests/test_core.pyindex f086cce93c..a07beb6517 100644--- a/tests/test_core.py+++ b/tests/test_core.py@@ -3,6 +3,7 @@ from unittest.mock import Mockimport pytestfrom django.shortcuts import reverse+from saleor.account.models import Address, Userfrom saleor.core.utils import (Country, create_superuser, get_country_by_ip, get_currency_for_country,random_data)@@ -10,7 +11,6 @@ from saleor.discount.models import Sale, Voucherfrom saleor.order.models import Orderfrom saleor.product.models import Productfrom saleor.shipping.models import ShippingMethod-from saleor.account.models import Address, Usertype_schema = {'Vegetable': {diff --git a/tests/test_elasticsearch.py b/tests/test_elasticsearch.pyindex 498fd9440c..755af1f865 100644--- a/tests/test_elasticsearch.py+++ b/tests/test_elasticsearch.py@@ -4,9 +4,9 @@ import pytestfrom django.urls import reversefrom elasticsearch_dsl.connections import connections+from saleor.account.models import Userfrom saleor.order.models import Orderfrom saleor.product.models import Product-from saleor.account.models import UserMATCH_SEARCH_REQUEST = ['method', 'host', 'port', 'path']STOREFRONT_PRODUCTS = {15, 56} # same as in recorded data!diff --git a/tests/test_order.py b/tests/test_order.pyindex 903ea50af2..e7b423c2ec 100644--- a/tests/test_order.py+++ b/tests/test_order.py@@ -130,7 +130,7 @@ def test_view_connect_order_with_user_different_email(response = authorized_client.post(url)redirect_location = get_redirect_location(response)- assert redirect_location == reverse('profile:details')+ assert redirect_location == reverse('account:details')order.refresh_from_db()assert order.user is Nonediff --git a/tests/test_postgresql_search.py b/tests/test_postgresql_search.pyindex 00fc65caa9..280791bef0 100644--- a/tests/test_postgresql_search.py+++ b/tests/test_postgresql_search.py@@ -3,9 +3,9 @@ from decimal import Decimalimport pytestfrom django.urls import reverse+from saleor.account.models import Address, Userfrom saleor.order.models import Orderfrom saleor.product.models import Product-from saleor.account.models import Address, User@pytest.fixture(scope='function', autouse=True)diff --git a/tests/test_userprofile.py b/tests/test_userprofile.pyindex 1d11f12158..9250e0d073 100644--- a/tests/test_userprofile.py+++ b/tests/test_userprofile.py@@ -117,12 +117,12 @@ def test_validate_possible_number(input, exception):def test_order_with_lines_pagination(admin_client, order_list):settings.PAGINATE_BY = 1data = {'page': '1'}- url = reverse('profile:details')+ url = reverse('account:details')response = admin_client.get(url, data)assert response.status_code == 200data = {'page': '2'}- url = reverse('profile:details')+ url = reverse('account:details')response = admin_client.get(url, data)assert response.status_code == 200