Skip to content

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

Closed
@samuelharmer

Description

@samuelharmer

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'}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions