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

fixed validation in create group api #16

Closed
wants to merge 1 commit into from
Closed

fixed validation in create group api #16

wants to merge 1 commit into from

Conversation

kiranrokkam09
Copy link

What change does this PR introduce?
This PR fixes the validation in create group

Why was this change needed?
The change needed to ensure only the authenticated user can send the mail.

Fixes #9

@@ -29,6 +29,13 @@ def get_queryset(self):
return Groups.objects.filter(user=self.request.user.id)

def post(self, request, *args, **kwargs):

if not request.user.is_authenticated:
Copy link
Member

Choose a reason for hiding this comment

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

authentication is being checked above.
on line 22
permission_classes = [IsAuthenticated]
you have to validate if the authenticated user is the same user that is being passed in the json request of the api.

Copy link
Author

Choose a reason for hiding this comment

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

ok then i will change it and again make the pull request

@kiranrokkam09 kiranrokkam09 closed this by deleting the head repository Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validation in create group API
2 participants