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

[BUG]: can't edit original storage location of a distribution when storage location has total inventory 0 #4537

Closed
4 tasks done
jimmyli97 opened this issue Jul 17, 2024 · 0 comments · Fixed by #4538
Closed
4 tasks done
Labels

Comments

@jimmyli97
Copy link
Contributor

jimmyli97 commented Jul 17, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

If a distribution sets the storage location to total inventory 0 and read_events is enabled, the original storage location won't show up when editing the distribution. Submission fails with "Couldn't find StorageLocation with 'id'=". You have to get this error message before the storage location becomes visible again and you can properly save.

(Ran across this when testing DistributionCreateService)

Expected Behavior

You should be able to edit the distribution at the original storage location without having to go through the error

Steps To Reproduce

  1. Enable read_events
  2. Create a new storage location
  3. Create a donation to that storage location, e.g. Adult Briefs (1)
  4. Create a distribution which empties that storage location to total inventory 0, e.g. Adult Briefs (1)
  5. Attempt to edit this distribution and select the original storage location

Criteria for Completion

  • fix
  • write test

Anything else?

image

Code of Conduct

  • I've read the Code of Conduct and understand my responsibilities as a member of the Ruby for Good community
@jimmyli97 jimmyli97 changed the title [BUG]: distributions from a storage location can't be edited when storage location is at inventory 0 [BUG]: can't edit original storage location of a distribution when storage location has total inventory 0 Jul 17, 2024
@cielf cielf closed this as completed in 3477f43 Jul 17, 2024
cielf added a commit that referenced this issue Jul 17, 2024
Resolves #4537 fix storage location when total inventory is 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant