Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Fix line continuation syntax (no backslashes)
Marcin Gębala21dc9ff6c87e
diff --git a/saleor/dashboard/customer/views.py b/saleor/dashboard/customer/views.pyindex 1233f154a3..8bb39650bf 100644--- a/saleor/dashboard/customer/views.py+++ b/saleor/dashboard/customer/views.py@@ -15,13 +15,13 @@ def _search_customers(queryset, data):if data['name']:parts = data['name'].split()if len(parts) == 2:- query = (Q(addresses__first_name__icontains=parts[0])- | Q(addresses__last_name__icontains=parts[1])) \- | (Q(addresses__first_name__icontains=parts[1])- | Q(addresses__last_name__icontains=parts[0]))+ query = ((Q(addresses__first_name__icontains=parts[0]) |+ Q(addresses__last_name__icontains=parts[1])) |+ (Q(addresses__first_name__icontains=parts[1]) |+ Q(addresses__last_name__icontains=parts[0])))else:- query = Q(addresses__first_name__icontains=data['name']) \- | Q(addresses__last_name__istartswith=data['name'])+ query = (Q(addresses__first_name__icontains=data['name']) |+ Q(addresses__last_name__istartswith=data['name']))queryset = queryset.filter(query).distinct()return querysetdiff --git a/saleor/dashboard/order/views.py b/saleor/dashboard/order/views.pyindex 66dac6ed66..e850f6171d 100644--- a/saleor/dashboard/order/views.py+++ b/saleor/dashboard/order/views.py@@ -33,8 +33,8 @@ def order_details(request, pk):payment = order.payments.last()groups = order.groups.select_subclasses().all()for group in groups:- group.can_ship = payment and payment.status == 'confirmed' and \- group.status == 'new'+ group.can_ship = (payment and payment.status == 'confirmed' and+ group.status == 'new')note_form = OrderNoteForm(request.POST or None)if note_form.is_valid():@@ -47,8 +47,8 @@ def order_details(request, pk):captured = preauthorized = refunded = 0if payment:- ctx['can_capture'] = payment.status == 'preauth' \- and order.status != 'cancelled'+ ctx['can_capture'] = (payment.status == 'preauth' and+ order.status != 'cancelled')ctx['can_release'] = payment.status == 'preauth'ctx['can_refund'] = payment.status == 'confirmed'preauthorized = Price(payment.total, currency=payment.currency)diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 0c3ed356ed..afd86a088d 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -258,10 +258,10 @@ class OrderedItem(models.Model, ItemLine):self.save()comment = pgettext_lazy('Order history',- 'Changed quantity for product %(product)s from %(old_quantity)s \- to %(new_quantity)s' % {'new_quantity': new_quantity,- 'old_quantity': old_quantity,- 'product': self.product})+ 'Changed quantity for product %(product)s from %(old_quantity)s '+ 'to %(new_quantity)s' % {'new_quantity': new_quantity,+ 'old_quantity': old_quantity,+ 'product': self.product})order.history.create(status=order.status, comment=comment, user=user)self.delivery_group.update_delivery_cost()@@ -300,11 +300,11 @@ class OrderedItem(models.Model, ItemLine):comment = pgettext_lazy('Order history',- 'Moved %(quantity)s items %(item)s from group #%(old_group)s \- to group #%(new_group)s' % {'quantity': quantity,- 'item': self,- 'old_group': self.delivery_group.pk,- 'new_group': group.pk})+ 'Moved %(quantity)s items %(item)s from group #%(old_group)s '+ 'to group #%(new_group)s' % {'quantity': quantity,+ 'item': self,+ 'old_group': self.delivery_group.pk,+ 'new_group': group.pk})order = self.delivery_group.orderorder.history.create(status=order.status, comment=comment, user=user)