Skip to content

Commit 40d63f5

Browse files
Alexander Sommerschliz
authored andcommitted
Show shifts a user participates in user profile
If a user is added to a shift in a organisation he is not part of it is not shown in the user's overview. This change expands the appropriate filter.
1 parent cc4598e commit 40d63f5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • src/shiftings/accounts/views

src/shiftings/accounts/views/user.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
4545
else:
4646
shifts = Shift.objects.filter(Q(start__date__gte=today) &
4747
(Q(event__in=self.object.events) |
48-
Q(organization__in=self.object.organizations)))
48+
Q(organization__in=self.object.organizations) |
49+
Q(participants__user=self.object)))
4950
context['shifts'] = get_pagination_context(self.request, shifts.filter(self.get_filters()), 5, 'shifts')
5051
return context
5152

0 commit comments

Comments
 (0)