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

Disallow deleting accessories that have active checkouts #16435

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

marcusmoore
Copy link
Collaborator

This PR prevents deleting accessories that are checked out to assets or locations (we already prevent deleting accessories checked out to users). We already disable the button on the accessory show page but did not on the index page.

The API and UI controllers now take into account all checkouts to the accessory and the index has been updated to disable the button if the item has checkouts:
image

Copy link

what-the-diff bot commented Mar 6, 2025

PR Summary

  • Improved Deletion Process in Accessories Controllers:
    The code for removing accessories has been updated to consider the number of associated 'checkouts' before processing. This means that an accessory can only be deleted if it isn't tied to any checkouts, ensuring consistency.

  • Enhancements in Accessory Creation Process:
    There are two new ways to create accessories tied to specific 'assets' and 'locations'. These methods simplify and streamline the creation process.

  • Reliability Improvements in Deletion Tests:
    Tests regarding the deletion of accessories have been improved to include scenarios where accessories are tied to other 'users', 'assets', and 'locations'. This ensures that all potential situations are considered during testing, thereby improving the reliability of the process.

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

Successfully merging this pull request may close these issues.

1 participant