From 0269f05d23f6a09b8ae58d7fa257a105ac4d1aa7 Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 15 Nov 2021 09:42:07 -0500 Subject: [PATCH 1/2] Updated review completed emails to include grades --- Main/templates/emails/review_completed.html | 6 ++++-- Main/views.py | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Main/templates/emails/review_completed.html b/Main/templates/emails/review_completed.html index d077232..fe1b8ac 100644 --- a/Main/templates/emails/review_completed.html +++ b/Main/templates/emails/review_completed.html @@ -8,7 +8,9 @@ {% block body %}

We're emailing to let you know that a review by {{ review.student }} has been completed - by {{ review.reviewer }}

-

To view the grade, navigate to the Instructor section of the website and click the "view" link to the right of + by {{ review.reviewer }}.

+

Score: {{ review.score_fraction }}

+

Comments: {{ review.additional_comments|default:"No Additional Comments" }}

+

For more information, navigate to the Instructor section of the website and click the "view" link to the right of the review

{% endblock %} diff --git a/Main/views.py b/Main/views.py index e5215c3..8ae7da6 100644 --- a/Main/views.py +++ b/Main/views.py @@ -43,6 +43,7 @@ def send_email(subject_template: str, text_template: str, template_name: str, re """ for user in list(query_set): + print(review.score_fraction) html_content = render_to_string(template_name, {'target_user': user, 'review': review}) text_content = text_template.format(target_user=str(user), student=str(review.student), reviewer=str(review.reviewer)) @@ -518,13 +519,13 @@ class ReviewGradeView(LoginRequiredMixin, IsReviewerMixin, FormNameMixin, FormAl self.object.date_completed = datetime.now() self.object.save() + response = super().form_valid(form) send_email("Review completed by {reviewer}", "Hello, {target_user}, the review requested by {student} has been completed by {reviewer}.", "emails/review_completed.html", self.object, User.objects.filter(is_superuser=True)) - return super().form_valid(form) - + return response class ReviewDetailView(LoginRequiredMixin, DetailView): """ -- knotmirror 0.0.1 From d019e78008ffd9bbe3210f093473b2f1d21e575b Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 15 Nov 2021 09:45:25 -0500 Subject: [PATCH 2/2] Removed print statement --- Main/views.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Main/views.py b/Main/views.py index 8ae7da6..3be1944 100644 --- a/Main/views.py +++ b/Main/views.py @@ -43,7 +43,6 @@ def send_email(subject_template: str, text_template: str, template_name: str, re """ for user in list(query_set): - print(review.score_fraction) html_content = render_to_string(template_name, {'target_user': user, 'review': review}) text_content = text_template.format(target_user=str(user), student=str(review.student), reviewer=str(review.reviewer)) -- knotmirror 0.0.1