| |
@@ -487,6 +487,16 @@
|
| |
)
|
| |
|
| |
collaborator_groups = relation(
|
| |
+ "PagureGroup",
|
| |
+ secondary="projects_groups",
|
| |
+ primaryjoin="projects.c.id==projects_groups.c.project_id",
|
| |
+ secondaryjoin="and_(pagure_group.c.id==projects_groups.c.group_id,\
|
| |
+ projects_groups.c.access=='collaborator')",
|
| |
+ order_by="PagureGroup.group_name.asc()",
|
| |
+ viewonly=True,
|
| |
+ )
|
| |
+
|
| |
+ collaborator_project_groups = relation(
|
| |
"ProjectGroup",
|
| |
primaryjoin="and_(projects.c.id==projects_groups.c.project_id,\
|
| |
projects_groups.c.access=='collaborator')",
|
| |
@@ -1000,9 +1010,8 @@
|
| |
elif access == "collaborator":
|
| |
committers = set(self.committer_groups)
|
| |
admins = set(self.admin_groups)
|
| |
- return list(
|
| |
- set(self.collaborator_groups) - committers - admins
|
| |
- )
|
| |
+ collaborators = set(self.collaborator_groups)
|
| |
+ return list(collaborators - committers - admins)
|
| |
elif access == "ticket":
|
| |
committers = set(self.committer_groups)
|
| |
admins = set(self.admin_groups)
|
| |
We need two mappings on a regular basis. One linking a project to its
group of collaborator and pointing to the PagureGroup objects directly.
This is used for example to retrieve the list of collaborator groups.
The one mapping is between a project and the corresponding ProjectGroup
for collaborators which is where the "branches" that the group is
restricted to is stored.
So we now have both mappings available and we need to be careful to use
the proper one, but pagure will quickly indicate (ie: crash) if one
uses the wrong one and tries to access either the group name or the
branches attribute.
Fixes https://pagure.io/fedora-infrastructure/issue/9247
Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr