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

Prevent to delete a user if still has consumables associated to them #11663

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Aug 11, 2022

Description

If users have consumables assigned to them the system still let 'em to get deleted, which with other type of items is not permitted. This PR adds that functionality to the API and the 'normal' controller.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1
  • MySQL version: 8.0.23
  • Webserver version: nginx/1.19.8
  • OS version: Debian 10

Checklist:

@inietov inietov mentioned this pull request Aug 11, 2022
2 tasks
@snipe snipe merged commit 60d1578 into snipe:develop Aug 14, 2022
@snipe
Copy link
Owner

snipe commented Aug 14, 2022

Wait, since consumables can't be checked in ever, doesn't that mean that the user will never be able to be checked in?

@snipe
Copy link
Owner

snipe commented Aug 14, 2022

(I may have to revert this change)

@snipe
Copy link
Owner

snipe commented Aug 14, 2022

We could maybe add a setting where we determine what that behavior should be - delete consumables on user delete or put them back into stock. Seems like that behavior could vary a bit tho depending on the consumable. (I personally would think that if it's a consumable, you wouldn't put it back into stock when a user is deleted, since it will likely be at least partially used, and that gets us down a rabbit hole...)

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.

2 participants