Skip to content

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

Make function names more precise

akjanik6c12c6e7ef54
diff --git a/saleor/checkout/forms.py b/saleor/checkout/forms.py
index dcb0a4cb51..7fae10f3b1 100644
--- a/saleor/checkout/forms.py
+++ b/saleor/checkout/forms.py
@@ -124,5 +124,5 @@ class NoteForm(forms.Form):
self.checkout = kwargs.pop('checkout', None)
super().__init__(*args, **kwargs)
- def update_checkout(self):
+ def set_checkout_note(self):
self.checkout.note = self.cleaned_data.get('note', '')
diff --git a/saleor/checkout/views/summary.py b/saleor/checkout/views/summary.py
index b7c203223a..385ca44acc 100644
--- a/saleor/checkout/views/summary.py
+++ b/saleor/checkout/views/summary.py
@@ -95,7 +95,7 @@ def summary_with_shipping_view(request, checkout):
"""
note_form = NoteForm(request.POST or None, checkout=checkout)
if note_form.is_valid():
- note_form.update_checkout()
+ note_form.set_checkout_note()
if request.user.is_authenticated:
additional_addresses = request.user.addresses.all()
@@ -123,7 +123,7 @@ def anonymous_summary_without_shipping(request, checkout):
"""
note_form = NoteForm(request.POST or None, checkout=checkout)
if note_form.is_valid():
- note_form.update_checkout()
+ note_form.set_checkout_note()
user_form = AnonymousUserBillingForm(
request.POST or None, initial={'email': checkout.email})
billing_address = checkout.billing_address
@@ -153,7 +153,7 @@ def summary_without_shipping(request, checkout):
"""
note_form = NoteForm(request.POST or None, checkout=checkout)
if note_form.is_valid():
- note_form.update_checkout()
+ note_form.set_checkout_note()
billing_address = checkout.billing_address
user_addresses = request.user.addresses.all()
diff --git a/tests/test_checkout.py b/tests/test_checkout.py
index 502aa13362..10ab70bace 100644
--- a/tests/test_checkout.py
+++ b/tests/test_checkout.py
@@ -232,7 +232,7 @@ def test_note_form():
checkout = Checkout(Mock(), AnonymousUser(), 'tracking_code')
form = NoteForm({'note': 'test_note'}, checkout=checkout)
form.is_valid()
- form.update_checkout()
+ form.set_checkout_note()
assert checkout.note == 'test_note'