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

Make viewset actions more consistent #2120

Merged
merged 6 commits into from
Jun 7, 2023
Merged

Conversation

vstpme
Copy link
Member

@vstpme vstpme commented Jun 7, 2023

What this PR does

Makes sure that all viewset actions with detail=True use self.get_object() to retrieve an instance that's being acted upon.

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 changed the title Vadimkerr/detail actions get object Use self.get_object() in all viewset actions Jun 7, 2023
@vstpme vstpme added the pr:no public docs Added to a PR that does not require public documentation updates label Jun 7, 2023
@vstpme vstpme changed the title Use self.get_object() in all viewset actions Make viewset actions more consistent Jun 7, 2023
@vstpme vstpme marked this pull request as ready for review June 7, 2023 11:01
@vstpme vstpme requested a review from a team June 7, 2023 11:01
Copy link
Contributor

@matiasb matiasb left a comment

Choose a reason for hiding this comment

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

LGTM

@vstpme vstpme added this pull request to the merge queue Jun 7, 2023
Merged via the queue into dev with commit 6860502 Jun 7, 2023
@vstpme vstpme deleted the vadimkerr/detail-actions-get-object branch June 7, 2023 12:15
@@ -41,6 +41,9 @@ class OnCallScheduleChannelView(RateLimitHeadersMixin, UpdateSerializerMixin, Mo
filter_backends = (filters.DjangoFilterBackend,)
filterset_class = ByTeamFilter

# self.get_object() is not used in export action because ScheduleExportAuthentication is used
extra_actions_ignore_no_get_object = ["export"]
Copy link
Contributor

Choose a reason for hiding this comment

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

how is this attribute consumed?

Copy link
Contributor

Choose a reason for hiding this comment

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

ohh nvm, I see it's used in the new unit test here. Nice! 👍

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