-
Notifications
You must be signed in to change notification settings - Fork 21
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
Added a SlotModificationService to do shift deletion and updates in a controlled way. #497
Conversation
…ions in SlotModificationService First tests, for now only for SlotModificationService.pick_shift_templates
@tvedeane I added a few tests, hopefully they help understand what's happening! |
Co-authored-by: Marek J <[email protected]>
…dated by comparing sets instead of lists, since the order doesn't matter (test was green on my machine but red in github actions)
} | ||
|
||
@classmethod | ||
def preview_changes( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems this method is not used, did you add it for future use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I thought we may want to see if a change would affect anyone before applying the changes.
Since we want to many slots now and later make slot deletion available for Vorstand members, I made a little service that searches for the most appropriate slots to update (the ones without a member registered to them if available) and prints out which members are affected by the changes so that they can be contacted if necessary.
I added a management command so that it's easy to test, edit the command then run:
docker compose exec web poetry run python manage.py test_slot_modification_service
I'm hoping it could be used as a base or as a reference if we make slot deletion available for Vorstand members.
I'm fairly confident that it works as intended, but it'd be great to have some feedback on how readable it is. Thanks!