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

Inconsistent handling of groups with roles assigned to them through memberships #220

Closed
samuelharmer opened this issue Feb 21, 2019 · 2 comments
Assignees
Labels

Comments

@samuelharmer
Copy link

samuelharmer commented Feb 21, 2019

I have been experiencing a strange bug with my code and have tracked it down to inconsistent handling of resources retrieved via project.memberships.

proj = redmine.project.get('citadel')
proj.memberships[0].group
Out[1]: {'id': 1, 'name': 'Council of Ricks'}
proj.memberships[1].user
Out[7]: <redminelib.resources.User #3 "Maximums Rickimus">

I would expect .group to be of type redminelib.resources.Group rather than a dict.

I'm assuming it's something to do with the way class ProjectMembership doesn't include any reference to groups. Perhaps this is as simple as changing L336 from:

    _resource_map = {'project': 'Project', 'user': 'User'}

to:

    _resource_map = {'project': 'Project', 'user': 'User', 'group': 'Group'}
@samuelharmer
Copy link
Author

Perhaps this is as simple as changing L336 from:

    _resource_map = {'project': 'Project', 'user': 'User'}

to:

    _resource_map = {'project': 'Project', 'user': 'User', 'group': 'Group'}

Yep; that seems to do it.

Are you happy to fix this?

maxtepkeev added a commit that referenced this issue Feb 22, 2019
@maxtepkeev maxtepkeev self-assigned this Feb 22, 2019
@maxtepkeev maxtepkeev added the bug label Feb 22, 2019
@maxtepkeev
Copy link
Owner

@samuelharmer Thanks for the bug report. This is fixed in d8aaa32.

Don't have time to do a release right now, but will do next week.

avgas3 pushed a commit to avgas3/python-redmine that referenced this issue Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants