#4331 pagure ui/app.py: pass on AttributeError of group.projects
Opened 8 months ago by jlanda. Modified 8 months ago
jlanda/pagure fix-dashboard-projects  into  master

file modified
+1 -1

@@ -218,7 +218,7 @@ 

                          access = repoaccess

          grouplist = []

          for group in groups:

-             if repo in group.projects:

+             if group and repo in group.projects:

                  thegroup = {"group_name": "", "access": ""}

                  thegroup["group_name"] = group.group_name

                  for a in repo.contributor_groups:

I just adjusting this to if group and repo in group.projects instead :)

rebased onto de9bb8a537c45a2ae71a971d8e466ead54da0a77

8 months ago

Anyhow, the code is going inside the for group in groups and the error comes from the projects attribute so wouldn't it be better a if group and group.projects and repo ?

I'll try to figure how can we test this during this weekend :)

rebased onto b20830a

8 months ago

The change itself looks good, I'm very curious about the test though (ie: how it got triggered :))

Can't reproduce this on a normal usage of pagure, just when I use dev-data.py -a so dunno how to proceed with it. Should I add tests against the weird dev-data.py db state? Does that worth it since it can not be reproduced using standard pagure workflows?

I think we should try to fix the dev-data script then :)

Note that we already test the dev-data script in the tests itself, so we could adjust this test to ensure the fix to dev-data does fix the situation.