diff --git a/pagure/lib/notify.py b/pagure/lib/notify.py index 05aa38b..0c47773 100644 --- a/pagure/lib/notify.py +++ b/pagure/lib/notify.py @@ -131,10 +131,10 @@ def _get_emails_for_issue(issue): # Add public notifications to lists/users set project-wide if issue.isa == 'issue' and not issue.private: - for notifs in issue.project.notifications.get('issues'): + for notifs in issue.project.notifications.get('issues', []): emails.add(notifs) elif issue.isa == 'pull-request': - for notifs in issue.project.notifications.get('requests'): + for notifs in issue.project.notifications.get('requests', []): emails.add(notifs) # Remove the person list in unwatch diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index f57522b..80b6860 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -933,6 +933,7 @@ class PagureLibtests(tests.Modeltests): 'Web-hooks': None, 'Enforce_signed-off_commits_in_pull-request': False, 'always_merge': False, + "issues_default_to_private": False, }, user='pingou', ) diff --git a/tests/test_pagure_lib_git.py b/tests/test_pagure_lib_git.py index 48122ee..27b39d7 100644 --- a/tests/test_pagure_lib_git.py +++ b/tests/test_pagure_lib_git.py @@ -713,7 +713,7 @@ new file mode 100644 index 0000000..60f7480 --- /dev/null +++ b/456 -@@ -0,0 +1,85 @@ +@@ -0,0 +1,87 @@ +{ + "assignee": null, + "branch": "master", @@ -741,6 +741,7 @@ index 0000000..60f7480 + "Web-hooks": null, + "always_merge": false, + "issue_tracker": true, ++ "issues_default_to_private": false, + "project_documentation": false, + "pull_requests": true + }, @@ -771,6 +772,7 @@ index 0000000..60f7480 + "Web-hooks": null, + "always_merge": false, + "issue_tracker": true, ++ "issues_default_to_private": false, + "project_documentation": false, + "pull_requests": true + },