mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-23 20:29:08 +00:00
[PR #11049/396f467b backport][stable-12] Improve Python code: address unused variables (#11058)
Improve Python code: address unused variables (#11049)
* Address F841 (unused variable).
* Reformat.
* Add changelog fragment.
* More cleanup.
* Remove trailing whitespace.
* Readd removed code as a comment with TODO.
(cherry picked from commit 396f467bbb)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
1eca76969a
commit
8cd80d94a0
90 changed files with 232 additions and 235 deletions
|
|
@ -197,7 +197,7 @@ class GitLabGroup:
|
|||
member = group.members.get(gitlab_user_id)
|
||||
if member:
|
||||
return member
|
||||
except gitlab.exceptions.GitlabGetError as e:
|
||||
except gitlab.exceptions.GitlabGetError:
|
||||
return None
|
||||
|
||||
# check if the user is a member of the group
|
||||
|
|
@ -210,7 +210,7 @@ class GitLabGroup:
|
|||
# add user to a group
|
||||
def add_member_to_group(self, gitlab_user_id, gitlab_group_id, access_level):
|
||||
group = self._gitlab.groups.get(gitlab_group_id)
|
||||
add_member = group.members.create({"user_id": gitlab_user_id, "access_level": access_level})
|
||||
group.members.create({"user_id": gitlab_user_id, "access_level": access_level})
|
||||
|
||||
# remove user from a group
|
||||
def remove_user_from_group(self, gitlab_user_id, gitlab_group_id):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue