#46 Include the groups with commit or admin access on the bugzilla list
Opened 6 years ago by pingou. Modified 2 years ago

file modified
+16
@@ -82,6 +82,22 @@ 

          elif user in output[namespace][package]:

              output[namespace][package].remove(user)

  

+     # Add the groups having commit or higher access

+     query = pagure.SESSION.query(

+         model.Project.namespace, model.Project.name,

+         model.PagureGroup.group_name

+     ).filter(

+         model.Project.id == model.ProjectGroup.project_id

+     ).filter(

+         model.ProjectGroup.group_id == model.PagureGroup.id

+     ).filter(

+         model.ProjectGroup.access.in_(['commit', 'admin'])

+     )

+ 

+     for entry in query.all():

+         namespace, package, grp = entry

+         output[namespace][package].add('@%s' % grp)

+ 

      # Convert the sets into lists

      final = collections.defaultdict(dict)

      for ns in output:

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto 78cc7ce

6 years ago

even for those who unwatch project?

That is a good question, so should we include the watch status (+ or -) instead of only the people watching (+) ?

@ralph, @ignatenkobrain what do you think?

I think primary key for filtering shoud be watch status. commiter/admin feels irrelevant here.

@ignatenkobrain, this is the case for users but pagure includes groups by default if they have commit/admin access since there is no logic to update the watch status of a group on a project.

Couldn't you use something like proposed in https://pagure.io/pagure-dist-git/issue/155 ?

That seems like the better solution... one file with all the info people need in one place?

Metadata