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

confluence.add_user_to_group is wrong #1422

Open
Mauwork opened this issue Jun 19, 2024 · 5 comments
Open

confluence.add_user_to_group is wrong #1422

Mauwork opened this issue Jun 19, 2024 · 5 comments

Comments

@Mauwork
Copy link
Contributor

Mauwork commented Jun 19, 2024

def add_user_to_group(self, username, group_name):

This function is using the wrong URL and it should be a "PUT" not a "POST" see:
https://docs.atlassian.com/ConfluenceServer/rest/8.2.0/#api/user/{username}/group/{groupName}-update
Fix that should work:

def add_user_to_group(self, username, group_name):
        """
        Add given user to a group

        :param username: str - username of user to add to group
        :param group_name: str - name of group to add user to
        :return: Current state of the group
        """
       url = f"rest/api/user/{username}/group/{group_name}"
       return self.put(url)
@gonchik
Copy link
Member

gonchik commented Jun 26, 2024

Hi @Mauwork ,
first of all, thank you for your detection.
please send PR

@Mauwork
Copy link
Contributor Author

Mauwork commented Jun 26, 2024

PR: #1425

@Mauwork
Copy link
Contributor Author

Mauwork commented Jul 17, 2024

Can someone point me to a place where I can add a test to cover the method ? So that the pull request can be merged ?

@Spacetown
Copy link
Contributor

In the test dir there are only two test files for confluence.

@Mauwork
Copy link
Contributor Author

Mauwork commented Jul 18, 2024

Thanks, I would have guessed that somewhere all the other methods are tested, but it does not seem to be the case. So I guess for previous commits the coverage was not a necessary criterion to merge a pull request ?

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

No branches or pull requests

3 participants