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

Remove unnecessary team checks #2606

Merged
merged 4 commits into from
Jul 21, 2023
Merged

Remove unnecessary team checks #2606

merged 4 commits into from
Jul 21, 2023

Conversation

vstpme
Copy link
Member

@vstpme vstpme commented Jul 20, 2023

What this PR does

Removes unnecessary team checks enforced by public API, as they seem to be outdated and not aligned with the web UI and docs.

From public docs:

Resources from different teams can be connected with one another. For instance, you can create an integration in one team, set up multiple routes for the integration, and utilize escalation chains from other teams. Users, schedules, and outgoing webhooks from other teams can also be included in the escalation chain.

Checklist

  • Unit, integration, and e2e (if applicable) tests updated
  • Documentation added (or pr:no public docs PR label added if not required)
  • CHANGELOG.md updated (or pr:no changelog PR label added if not required)

@vstpme vstpme added the pr:no public docs Added to a PR that does not require public documentation updates label Jul 20, 2023
@vstpme vstpme requested a review from a team July 20, 2023 19:23
for shift in shifts:
shift_team_id = shift.team.public_primary_key if shift.team else None
if shift_team_id != team_id:
raise BadRequest(detail="Shifts must be assigned to the same team as the schedule")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a case when shift belongs to the other team from the schedule?

Copy link
Member Author

@vstpme vstpme Jul 21, 2023

Choose a reason for hiding this comment

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

I don't think it's possible now but should be possible after merging this PR. I tried to create a shift for team X and a schedule for team Y using that shift, there were no issues with it. So unless we have a particular reason to enforce team checks here, I'd propose to remove them so it's consistent with other models.

@vstpme vstpme requested review from iskhakov and a team July 21, 2023 09:44
@vstpme vstpme merged commit 1d6767a into dev Jul 21, 2023
@vstpme vstpme deleted the vadimkerr/team-checks-public-api branch July 21, 2023 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:no public docs Added to a PR that does not require public documentation updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants