-
Notifications
You must be signed in to change notification settings - Fork 415
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
fix: Feature id in mv-option request is undefined #2751
fix: Feature id in mv-option request is undefined #2751
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Uffizzi Preview |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2751 +/- ##
==========================================
+ Coverage 95.51% 95.53% +0.01%
==========================================
Files 993 993
Lines 27971 28058 +87
==========================================
+ Hits 26717 26805 +88
+ Misses 1254 1253 -1
☔ View full report in Codecov by Sentry. |
api/features/multivariate/views.py
Outdated
@@ -33,6 +33,16 @@ def get_permissions(self): | |||
) | |||
] | |||
|
|||
def create(self, request, *args, **kwargs): | |||
feature_pk = self.kwargs.get("feature_pk") | |||
get_object_or_404(Feature, pk=feature_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.
This still isn't checking that it's a project they belong to.
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.
Is this being checked here, right?
def get_permissions(self): |
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.
No, looks like that is checking they have permissions on the project. So it should be sufficient to change this to:
feature_pk = self.kwargs.get("feature_pk")
project_pk = self.kwargs.get("project_pk")
get_object_or_404(Feature.objects.filter(project__id=project_pk), pk=feature_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.
Now I understand what you meant, Thank you, corrected.
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingChanges
How did you test this code?