SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 7f5e8c04 authored by Jean-Sébastien Caux's avatar Jean-Sébastien Caux
Browse files

Merge branch 'master' into dev_JSC_20230129_forums

parents e6dbffdd 25f2a44a
No related branches found
No related tags found
No related merge requests found
......@@ -3,11 +3,13 @@ __license__ = "AGPL v3"
from django.core.management import BaseCommand
from django.db.models import Count, Q
from ...models import EICRecommendation
from colleges.models import Fellowship, FellowshipNominationVotingRound
from mails.utils import DirectMailUtil
from submissions.models import Submission
class Command(BaseCommand):
......@@ -16,7 +18,18 @@ class Command(BaseCommand):
help = "Sends an email to Fellows with current and upcoming tasks list"
def handle(self, *args, **kwargs):
fellowships = Fellowship.objects.active()
fellowships = Fellowship.objects.active().annotate(
nr_visible=Count(
"pool",
filter=Q(pool__status=Submission.SEEKING_ASSIGNMENT),
distinct=True,
),
nr_appraised=Count(
"qualification",
filter=Q(pool__status=Submission.SEEKING_ASSIGNMENT),
distinct=True,
),
)
count = 0
for fellowship in fellowships:
......@@ -53,6 +66,11 @@ class Command(BaseCommand):
recs_to_vote_on=recs_to_vote_on,
assignments_ongoing=assignments_ongoing,
assignments_to_consider=assignments_to_consider,
nr_visible=fellowship.nr_visible,
nr_appraised=fellowship.nr_appraised,
nr_appraisals_required=(
fellowship.nr_visible-fellowship.nr_appraised
),
assignments_upcoming_deadline=assignments_upcoming_deadline,
)
mail_sender.send_mail()
......
......@@ -14,22 +14,39 @@
<p>Please go to the <a href="https://{{ domain }}{% url 'submissions:pool:pool' %}">pool</a> to cast your vote on:</p>
<ul>
{% for rec in recs_to_vote_on %}
<li>{{ rec.submission.title }}</li>
<li>{{ rec.submission.title }}</li>
{% endfor %}
</ul>
{% endif %}
{% if nr_visible > 0 %}
<br>
{% if nr_appraised < nr_visible %}
<h3>Appraisals required on Submissions seeking assignment</h3>
<p>
There are {{ nr_visible }} Submissions seeking assignment in the <a href="https://{{ domain }}{% url 'submissions:pool:pool' %}">pool</a>, {% if nr_appraised == 0 %}all of which{% else %}of which {{ nr_appraisals_required }}{% endif %} require your quick appraisal of your expertise level, competing interest and readiness to take charge.
</p>
<p>Please visit the pool and provide this info (whose maintenance is crucial to the Assignment phase of our <a href="https://{{ domain }}{% url 'submissions:editorial_workflow' %}">editorial workflow</a>).
</p>
{% else %}
<h3>Submissions seeking assignment</h3>
<p>There are {{ nr_visible }} Submissions seeking assignment in the <a href="https://{{ domain }}{% url 'submissions:pool:pool' %}">pool</a>; thank you
for having appraised your expertise level, competing interest and readiness to take charge for all of them. Great job!</p>
{% endif %}
{% endif %}
{% if assignments_to_consider %}
<br/>
<h3>Assignments for you to consider:</h3>
<ul>
<br/>
<h3>Assignments for you to consider:</h3>
<p><em>(note: these assignment requests are being phased out in favour of the appraisals system)</em></p>
<ul>
{% for assignment in assignments_to_consider %}
<li>
On submission: {{ assignment.submission }}<br>
<a href="https://{{ domain }}{% url 'submissions:pool:assignment_request' assignment.id %}">Accept or decline here</a>
</li>
<li>
On submission: {{ assignment.submission }}<br>
<a href="https://{{ domain }}{% url 'submissions:pool:assignment_request' assignment.id %}">Accept or decline here</a>
</li>
{% endfor %}
</ul>
</ul>
{% endif %}
{% if assignments_ongoing %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment