From a269b90842373ff64b57982ee4d094ee7aa6f98e Mon Sep 17 00:00:00 2001
From: Jorran de Wit <jorrandewit@outlook.com>
Date: Mon, 17 Sep 2018 07:58:04 +0200
Subject: [PATCH] Bug 1 (template url wrong, 500)

---
 colleges/models.py                            |  8 ++++-
 profiles/models.py                            | 11 +++----
 profiles/urls.py                              |  4 +--
 .../personal_page/editorial_actions.html      |  4 +--
 .../invite_potential_fellow_initial.html      | 32 ++++++++++++++++---
 5 files changed, 42 insertions(+), 17 deletions(-)

diff --git a/colleges/models.py b/colleges/models.py
index 5892fb922..0cbe4e520 100644
--- a/colleges/models.py
+++ b/colleges/models.py
@@ -76,7 +76,10 @@ class PotentialFellowship(models.Model):
 
     It is linked to Profile as ForeignKey and not as OneToOne, since the same
     person can eventually be approached on different occasions.
+
+    COMMENT: Why is this only nonregistered people only?
     """
+
     profile = models.ForeignKey('profiles.Profile', on_delete=models.CASCADE)
     status = models.CharField(max_length=32, choices=POTENTIAL_FELLOWSHIP_STATUSES,
                               default=POTENTIAL_FELLOWSHIP_IDENTIFIED)
@@ -86,10 +89,13 @@ class PotentialFellowship(models.Model):
 
 
 class PotentialFellowshipEvent(models.Model):
+    """Any event directly related to a PotentialFellowship instance registered as plain text."""
+
     potfel = models.ForeignKey('colleges.PotentialFellowship', on_delete=models.CASCADE)
     event = models.CharField(max_length=32, choices=POTENTIAL_FELLOWSHIP_EVENTS)
     comments = models.TextField(blank=True)
-    noted_on = models.DateTimeField(default=timezone.now)
+
+    noted_on = models.DateTimeField(auto_now_add=True)
     noted_by = models.ForeignKey('scipost.Contributor',
                                  on_delete=models.SET(get_sentinel_user),
                                  blank=True, null=True)
diff --git a/profiles/models.py b/profiles/models.py
index c420d3e80..ee8aea204 100644
--- a/profiles/models.py
+++ b/profiles/models.py
@@ -6,17 +6,15 @@ from django.db import models
 
 from scipost.behaviors import orcid_validator
 from scipost.constants import (
-    TITLE_CHOICES,
-    SCIPOST_DISCIPLINES, DISCIPLINE_PHYSICS,
-    SCIPOST_SUBJECT_AREAS,
-    )
+    TITLE_CHOICES, SCIPOST_DISCIPLINES, DISCIPLINE_PHYSICS, SCIPOST_SUBJECT_AREAS)
 from scipost.fields import ChoiceArrayField
 
 
 class Profile(models.Model):
     """
-    A Profile object instance contains information about an individual
-    who is a potential SciPost Contributor but is not necessarily registered.
+    A Profile object instance contains information about an individual.
+
+    This individual is a potential SciPost Contributor but is not necessarily registered.
     It is created and used by Admin, EdAdmin or other internal SciPost staff.
 
     For registered Contributors, a profile is initially created from the contributor-filled
@@ -34,6 +32,7 @@ class Profile(models.Model):
        #. mark somebody as not willing to receive emails from SciPost.
        #. mark somebody as a non-referee (if that person does not want to referee for SciPost)
     """
+
     title = models.CharField(max_length=4, choices=TITLE_CHOICES)
     first_name = models.CharField(max_length=64)
     last_name = models.CharField(max_length=64)
diff --git a/profiles/urls.py b/profiles/urls.py
index e52080326..01f07bc87 100644
--- a/profiles/urls.py
+++ b/profiles/urls.py
@@ -26,12 +26,12 @@ urlpatterns = [
         r'^(?P<discipline>[a-zA-Z]+)/(?P<expertise>[a-zA-Z:]+)/$',
         views.ProfileListView.as_view(),
         name='profiles'
-        ),
+    ),
     url(
         r'^(?P<discipline>[a-zA-Z]+)/$',
         views.ProfileListView.as_view(),
         name='profiles'
-        ),
+    ),
     url(
         r'^$',
         views.ProfileListView.as_view(),
diff --git a/scipost/templates/partials/scipost/personal_page/editorial_actions.html b/scipost/templates/partials/scipost/personal_page/editorial_actions.html
index e306f9d44..c2afc314b 100644
--- a/scipost/templates/partials/scipost/personal_page/editorial_actions.html
+++ b/scipost/templates/partials/scipost/personal_page/editorial_actions.html
@@ -111,9 +111,7 @@
 	    <h3>Colleges and Fellowships</h3>
 	    <ul>
 	      <li><a href="{% url 'colleges:potential_fellowships' %}">Manag Potential Fellowships</a></li>
-	      <!-- NEXT LINE TO BE DEPRECATED -->
-	      <li><a href="{% url 'colleges:prospective_Fellows' %}">Manage Prospective Fellows</a></li>
-              <li><a href="{% url 'colleges:fellowships' %}">Manage Fellowships</a></li>
+          <li><a href="{% url 'colleges:fellowships' %}">Manage Fellowships</a></li>
 	    </ul>
 	    {% endif %}
 
diff --git a/templates/email/potentialfellowships/invite_potential_fellow_initial.html b/templates/email/potentialfellowships/invite_potential_fellow_initial.html
index 68708a040..71fae8d06 100644
--- a/templates/email/potentialfellowships/invite_potential_fellow_initial.html
+++ b/templates/email/potentialfellowships/invite_potential_fellow_initial.html
@@ -1,9 +1,31 @@
 <p>Dear {{ potfel.profile.get_title_display }} {{ potfel.profile.last_name }},</p>
+
 <p>Hopefully you've already come across <a href="https://scipost.org{% url 'scipost:index' %}">SciPost</a> and are aware of our mission to establish a healthier infrastructure for scientific publishing.</p>
+
 <p>On behalf of the SciPost Foundation and in view of your professional expertise and reputation, I hereby would like to invite you to join our Editorial College and become one of our Editorial Fellows. We are currently making a big push for expansion of our activities, see <a href="https://scipost.org{% url 'scipost:ExpSustDrive2018' %}">this page</a> for details.</p>
-<p>Please note that only well-known and respected senior academics are being contacted for this purpose. Academic reputation and involvement in the community are the most important criteria guiding our considerations of who should belong to the Editorial College. The current list of Fellows can be found at <a href="https://scipost.org{% url 'scipost:about' %}">scipost.org/about</a>; on this page, you will also find basic information on SciPost and its guiding principles (you can also take a look at our <a href="https://scipost.org{% url 'scipost:FAQ' %}">frequently asked questions page</a>).</p>
-<p>We do not pose any conditions on your involvement, and you would always remain in complete control of your level of commitment (devoting even a couple of hours per month would be enough to help out significantly). Functioning of the College proceeds according to the by-laws set out at <a href="https://scipost.org{% url 'scipost:EdCol_by-laws' %}">scipost.org/EdCol_by-laws</a>, and a short summary of the editorial workflow can be found at <a href="https://scipost.org{% url 'submissions:editorial_workflow' %}">this page</a>.
-<p>I would be very happy to provide you with more information should you require it. Could I beg you to give us a response (by replying to this email) within the next couple of weeks?</p>
-<p>Many thanks in advance,</p>
-<p>Prof. J.-S. Caux, on behalf of the SciPost Foundation</p>
+
+<p>
+    Please note that only well-known and respected senior academics are being contacted for this purpose.
+    Academic reputation and involvement in the community are the most important criteria guiding our considerations of who should belong to the Editorial College.
+    The current list of Fellows can be found at <a href="https://scipost.org{% url 'scipost:about' %}">scipost.org/about</a>; on this page, you will also find basic information on SciPost and its guiding principles (you can also take a look at our <a href="https://scipost.org{% url 'scipost:FAQ' %}">frequently asked questions page</a>).
+</p>
+
+<p>
+    We do not pose any conditions on your involvement, and you would always remain in complete control of your level of commitment (devoting even a couple of hours per month would be enough to help out significantly).
+    Functioning of the College proceeds according to the by-laws set out at <a href="https://scipost.org{% url 'scipost:EdCol_by-laws' %}">scipost.org/EdCol_by-laws</a>,
+    and a short summary of the editorial workflow can be found at <a href="https://scipost.org{% url 'submissions:editorial_workflow' %}">this page</a>.
+</p>
+
+<p>
+    I would be very happy to provide you with more information should you require it. Could I beg you to give us a response (by replying to this email) within the next couple of weeks?
+</p>
+
+<p>
+    Many thanks in advance,
+</p>
+<p>
+    Prof. J.-S. Caux,
+    on behalf of the SciPost Foundation
+</p>
+
 {% include 'email/_footer.html' %}
-- 
GitLab