Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements on shipping validation #3812

Closed

Conversation

jxltom
Copy link
Contributor

@jxltom jxltom commented Mar 7, 2019

  • Reuse is_valid_shipping_method in API (clean_checkout) and storefront 1.0 (clean_shipping_method)
  • Split clean_shipping_method to clean_shipping_method and clean_shipping_address. They are used in CheckoutLinesAdd/CheckoutLineUpdate/CheckoutLineDelete/CheckoutShippingAddressUpdate/CheckoutShippingMethodUpdate. I feels both address and method should be validated after cart line/shipping method/shipping address are updated.
  • Fix a bug where address and method should be validated after cart line is updated in CheckoutLinesAdd/CheckoutLineUpdate
  • Fix a bug where checkout is not returned if method/address is invalid in CheckoutLinesAdd/CheckoutLineUpdate
  • Fix a bug where shipping method should be deleted only when it's invalid in clean_shipping_method
  • Fix a bug where is_valid_shipping_method will raise error if cart doesn't have a shipping address
  • Fix bug where Country should be used instead of string for address's country field in tests.

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. Database migration files are up to date.
  6. The changes are tested.
  7. The code is documented (docstrings, project documentation).
  8. GraphQL schema and type definitions are up to date.
  9. Changes are mentioned in the changelog.

@codecov
Copy link

codecov bot commented Mar 7, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@e81494c). Click here to learn what that means.
The diff coverage is 92.1%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #3812   +/-   ##
=========================================
  Coverage          ?   91.61%           
=========================================
  Files             ?      277           
  Lines             ?    15153           
  Branches          ?     1489           
=========================================
  Hits              ?    13883           
  Misses            ?      870           
  Partials          ?      400
Impacted Files Coverage Δ
saleor/checkout/views/__init__.py 84.37% <ø> (ø)
saleor/checkout/utils.py 82.17% <87.5%> (ø)
saleor/graphql/checkout/mutations.py 95.7% <93.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e81494c...e785e25. Read the comment docs.

@jxltom jxltom force-pushed the improvements-on-shipping-validation branch from 33f65d6 to 06b1c81 Compare March 15, 2019 01:21
@jxltom
Copy link
Contributor Author

jxltom commented Mar 18, 2019

@auvipy Is this an auto reply? 😄

@jxltom jxltom mentioned this pull request Mar 27, 2019
9 tasks
Copy link

@auvipy auvipy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please rebase.

@jxltom
Copy link
Contributor Author

jxltom commented May 7, 2019

@maarcingebala This PR is updated with master branch, please review. Thanks.

@jxltom jxltom force-pushed the improvements-on-shipping-validation branch 2 times, most recently from 048a558 to f8efe64 Compare May 10, 2019 01:46
@jxltom jxltom force-pushed the improvements-on-shipping-validation branch from f8efe64 to e785e25 Compare May 10, 2019 02:03
@maarcingebala
Copy link
Member

Closing in favor of #4367 where we're working on improved behavior of checkout API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants