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

Rescue Spree::Order::InsufficientStock in backend #1359

Merged

Conversation

DanielePalombo
Copy link
Contributor

When an order contains a line_item which requires a quantity greater
than available in not
backorderable stock items, a Spree::Order::InsufficientStock exception
is raised, but there
are no rescue in controllers.

This change adds the rescue for Payments and CustomerDetails
controllers, displays an
:insufficient_stock_for_order error message and redirects to the
specific page.

Still needs to be ported in Spree::Api controllers

ref #566

@jhawthorn
Copy link
Contributor

👍 (pending whitespace fixes)

Thanks for the specs

When an order contains a line_item which requires a quantity greater
than available in not
backorderable stock items, a Spree::Order::InsufficientStock exception
is raised, but there
are no rescue in controllers.

This change adds the rescue for Payments and CustomerDetails
controllers, displays an
`:insufficient_stock_for_order` error message and redirects to the
specific page.
@DanielePalombo DanielePalombo force-pushed the backend-detect-insufficient-stock branch from 0d8442a to 566f3b2 Compare July 30, 2016 12:30
@mamhoff
Copy link
Contributor

mamhoff commented Aug 2, 2016

👍

@jhawthorn jhawthorn merged commit ae164cc into solidusio:master Aug 3, 2016
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.

3 participants