-
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
Make viewset actions more consistent #2120
Conversation
self.get_object()
in all viewset actions
self.get_object()
in all viewset actionsThere 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.
LGTM
@@ -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"] |
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.
how is this attribute consumed?
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.
ohh nvm, I see it's used in the new unit test here. Nice! 👍
What this PR does
Makes sure that all viewset actions with
detail=True
useself.get_object()
to retrieve an instance that's being acted upon.Checklist
pr:no public docs
PR label added if not required)CHANGELOG.md
updated (orpr:no changelog
PR label added if not required)