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

Added cashier shift capability & Check shift capabilities on user self registration. #120

Merged
merged 2 commits into from Sep 7, 2021

Conversation

Theophile-Madet
Copy link
Contributor

Hey,
I just wanted to check that this is what you intended with the shift capabilities.

Added a form to edit user shift capabilities.
Only allow self registration for flying shifts if the user has the appropriate capability.
Updated populate function to give random shift capabilities to some users.
Copy link
Contributor

@leonhandreke leonhandreke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, were we already checking before (or rather, not showing the button)? I don't see any change in that direction.

@@ -17,10 +17,12 @@

class ShiftUserCapability:
SHIFT_COORDINATOR = "shift_coordinator"
TRAINED_CASHIER = "trained_cashier"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) Maybe make this just CASHIER? Shift Coordinators are also trained...

@@ -82,6 +83,7 @@ def get_context_data(self, **kwargs):
for slot in slots:
slot.can_register = slot.user_can_attend(self.request.user)
context["slots"] = slots
context["shift_is_in_the_future"] = context["shift"].start_time > timezone.now()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need this in quite a few places, maybe we can just make this a model method? Sort of hacky though..

@Theophile-Madet Theophile-Madet merged commit d7221af into master Sep 7, 2021
@Theophile-Madet
Copy link
Contributor Author

I keep trying to find out why I wrote "Check shift capabilities" but I have no idea...

@Theophile-Madet
Copy link
Contributor Author

Ah I think I got it!
I must have mixed it up with the issue that I linked, but the other thing that was in the PR was that we can now edit the user's capabilities. There's an edit button on shift shift card from the user detail page.

@Theophile-Madet Theophile-Madet deleted the added_cashier_shift_capabilitiy branch September 18, 2021 06:01
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.

Prevent flying members to register for Kasse and Teamleitung slots.
2 participants