From dc16031edfe21597c161725bbc0b64cb5827f8e8 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 06 2017 16:35:53 +0000 Subject: Make the notify argument be optional and default it to False This fixes running the unit-tests --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 66f57ba..5aa6ccb 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -3730,7 +3730,8 @@ def save_report(session, repo, name, url, username): session.add(repo) -def set_custom_key_fields(session, project, fields, types, data, notify): +def set_custom_key_fields( + session, project, fields, types, data, notify=None): """ Set or update the custom key fields of a project with the values provided. "data" is currently only used for lists """ @@ -3750,7 +3751,7 @@ def set_custom_key_fields(session, project, fields, types, data, notify): for item in data[idx].split(',') ] - if notify[idx] == "on": + if notify and notify[idx] == "on": notify_flag = True else: notify_flag = False