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

Comments

Projects
None yet
2 participants
@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

This comment has been minimized.

Copy link
Author

samuelharmer commented Feb 21, 2019

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

This comment has been minimized.

Copy link
Owner

maxtepkeev commented Feb 22, 2019

@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.

@maxtepkeev maxtepkeev closed this Feb 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.