-
Notifications
You must be signed in to change notification settings - Fork 299
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
Apply shift swap requests to schedule events #2677
Conversation
Q(**User.build_permissions_query(RBACPermission.Permissions.SCHEDULES_WRITE, organization)) | ||
& (Q(username__in=usernames) | Q(email__lower__in=emails)) | ||
) | ||
|
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.
Iterating over schedule events and getting users with an OR
query doesn't seem better than going the original path (did some testing). Also, when applying swaps, if a user wasn't part of the original schedule, we don't get that user information.
# TODO: implement the actual override logic in https://github.com/grafana/oncall/issues/2590 | ||
# make sure final schedule ical representation is updated | ||
refresh_ical_final_schedule.apply_async((self.schedule.pk,)) |
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.
❤️
0328aa3
to
7cd0b77
Compare
7cd0b77
to
11f5b80
Compare
engine/apps/schedules/ical_utils.py
Outdated
@@ -61,7 +60,6 @@ | |||
def users_in_ical( | |||
usernames_from_ical: typing.List[str], | |||
organization: "Organization", | |||
users_to_filter: typing.Optional["UserQuerySet"] = None, | |||
) -> typing.Sequence["User"]: |
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 can probably change the return type here. I believe it was like this to accommodate the union between a list and a queryset
058fb09
to
fd95dc8
Compare
fd95dc8
to
c788b93
Compare
Reflect swap requests details in schedule events.