From ee286ac5d49f8dd76752b2266ce793c25f1fdca1 Mon Sep 17 00:00:00 2001
From: Frank Duncan <frankduncan@opentechstrategies.com>
Date: Fri, 28 Jun 2024 10:33:29 -0500
Subject: [PATCH] Remove None reviewers from validation

This was caused by an issue where the "---" (None) reviewers were
causing the validation to fail, meaning that you had to fill out n-1
reviewers in the submission page in order for the save to go through.

The solution was to only check for duplicates with reviewers that were
selected.

Issue ots/clients/smex/hypha-tracker#2: Can't assign Staff
as reviewers of applications
---
 hypha/apply/funds/forms.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hypha/apply/funds/forms.py b/hypha/apply/funds/forms.py
index b69fcfdef..43e77ce53 100644
--- a/hypha/apply/funds/forms.py
+++ b/hypha/apply/funds/forms.py
@@ -300,7 +300,7 @@ class UpdateReviewersForm(ApplicationSubmissionModelForm):
         role_reviewers = [
             user
             for field, user in self.cleaned_data.items()
-            if field in self.role_fields
+            if field in self.role_fields and user
         ]
 
         for field, role in self.role_fields.items():
-- 
GitLab