Skip to content

Cancel shifttemplate - #773

Open
crosspolar wants to merge 17 commits into
masterfrom
cancel_shifttemplate
Open

Cancel shifttemplate#773
crosspolar wants to merge 17 commits into
masterfrom
cancel_shifttemplate

Conversation

@crosspolar

Copy link
Copy Markdown
Contributor
  • Cancels all shifts after specified date
  • Doesn't create new shifts after specified date

# Conflicts:
#	tapir/shifts/views/views.py
#	tapir/translations/locale/de/LC_MESSAGES/django.po

@Theophile-Madet Theophile-Madet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we can use ShiftCancellationService.cancel as is: that would give many shift points to users that were registered as ABCD. Maybe add a parameter to cancel, something like abcd_attendances_get_points, that we would set to false?

Comment thread tapir/shifts/templates/shifts/shift_template_set_end_date.html Outdated
Comment thread tapir/shifts/views/views.py Outdated
@crosspolar

Copy link
Copy Markdown
Contributor Author

don't think we can use ShiftCancellationService.cancel as is: that would give many shift points to users that were registered as ABCD. Maybe add a parameter to cancel, something like abcd_attendances_get_points, that we would set to false?

Just a thought, but maybe ShiftCancellationService.cancel should only grant shift point for the next shift in ABCD in general

@Theophile-Madet Theophile-Madet left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just a thought, but maybe ShiftCancellationService.cancel should only grant shift point for the next shift in ABCD in general

What other cases are you thinking about?
When cancelling a single shift, we should give a point even if the cancelled shift is in 3 months, no?

Comment on lines +124 to +133
# should be created
ShiftGenerator.create_shifts_for_group(
at_date=datetime.date(2025, 11, 10), group=group_a
)

# should not be created
ShiftGenerator.create_shifts_for_group(
at_date=datetime.date(2025, 11, 24), group=group_a
)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should make 2 test cases for this, or at least assert between the creations.

Comment thread tapir/shifts/models.py
Comment on lines +299 to +300
if self.start_time and self.end_time:
if self.start_time >= self.end_time:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We can merge the two ifs.

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.

Don't delete abcd shifts and abcd slots, instead add a start and end date to them.

2 participants