From 2079fa744ecbcfcb84241deb6035b390458c3948 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Mon, 14 Jan 2019 18:40:05 +0100
Subject: [PATCH] Debug PotFelForm

---
 colleges/forms.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/colleges/forms.py b/colleges/forms.py
index aa1bd47ee..302d050a7 100644
--- a/colleges/forms.py
+++ b/colleges/forms.py
@@ -241,11 +241,13 @@ class PotentialFellowshipForm(RequestFormMixin, forms.ModelForm):
         or by an existing Fellow, the status is set to NOMINATED and
         the person nominating is added to the list of in_agreement with election.
         """
+        potfel = super().save()
         if self.request.user.groups.filter(name__in=[
-                'AdvisoryBoard', 'EditorialCollege']).exists():
-            self.instance.status = POTENTIAL_FELLOWSHIP_NOMINATED
-            self.instance.in_agreement.add(self.request.user.contributor)
-        return super().save()
+                'Advisory Board', 'Editorial College']).exists():
+            potfel.status = POTENTIAL_FELLOWSHIP_NOMINATED
+            potfel.in_agreement.add(self.request.user.contributor)
+        potfel.save()
+        return potfel
 
 
 class PotentialFellowshipStatusForm(forms.ModelForm):
-- 
GitLab