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
Conversation
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.
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.
Hm, were we already checking before (or rather, not showing the button)? I don't see any change in that direction.
tapir/shifts/models.py
Outdated
@@ -17,10 +17,12 @@ | |||
|
|||
class ShiftUserCapability: | |||
SHIFT_COORDINATOR = "shift_coordinator" | |||
TRAINED_CASHIER = "trained_cashier" |
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.
(nit) Maybe make this just CASHIER
? Shift Coordinators are also trained...
tapir/shifts/views.py
Outdated
@@ -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() |
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.
We'll need this in quite a few places, maybe we can just make this a model method? Sort of hacky though..
… in the Shift model.
I keep trying to find out why I wrote "Check shift capabilities" but I have no idea... |
Ah I think I got it! |
Hey,
I just wanted to check that this is what you intended with the shift capabilities.