From d6bbbb4d6c1d8f1401a0c9386f6ff0e3a18529e7 Mon Sep 17 00:00:00 2001 From: "J.-S. Caux" <J.S.Caux@uva.nl> Date: Mon, 28 Mar 2016 20:44:00 +0200 Subject: [PATCH] Correct bugs in theses comments vetting --- commentaries/models.py | 2 +- comments/views.py | 6 ++++++ submissions/models.py | 2 +- theses/models.py | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/commentaries/models.py b/commentaries/models.py index 89008d798..d22ff7fc8 100644 --- a/commentaries/models.py +++ b/commentaries/models.py @@ -43,7 +43,7 @@ class Commentary(models.Model): header += '<tr><td>Title: </td><td> </td><td>' + self.pub_title + '</td></tr>' header += '<tr><td>Author(s): </td><td> </td><td>' + self.author_list + '</td></tr>' if self.type == 'published': - header += '<tr><td>DOI: </td><td> </td><td><a href="' + self.pub_DOI_link + '">' + self.pub_DOI_link + '</a></td></tr>' + header += '<tr><td>DOI: </td><td> </td><td><a href="' + self.pub_DOI_link + '" target="_blank">' + self.pub_DOI_link + '</a></td></tr>' elif self.type == 'preprint': header += '<tr><td>arxiv Link: </td><td> </td><td><a href="' + self.arxiv_link + '">' + self.arxiv_link + '</a></td></tr>' header += '<tr><td>Date: </td><td> </td><td>' + str(self.pub_date) + '</td></tr>' diff --git a/comments/views.py b/comments/views.py index 2e3bcef7f..e0f046974 100644 --- a/comments/views.py +++ b/comments/views.py @@ -43,6 +43,10 @@ def vet_submitted_comment_ack(request, comment_id): email_text += comment.submission.title + ' by ' + comment.submission.author_list comment.submission.latest_activity = timezone.now() comment.submission.save() + elif comment.thesislink is not None: + email_text += comment.thesislink.title + ' by ' + comment.thesis.author + comment.thesislink.latest_activity = timezone.now() + comment.thesislink.save() email_text += (', has been accepted and published online.' + '\n\nWe copy it below for your convenience.' + '\n\nThank you for your contribution, \nThe SciPost Team.' + @@ -62,6 +66,8 @@ def vet_submitted_comment_ack(request, comment_id): email_text += comment.commentary.pub_title + ' by ' + comment.commentary.author_list elif comment.submission is not None: email_text += comment.submission.title + ' by ' + comment.submission.author_list + elif comment.thesislink is not None: + email_text += comment.thesislink.title + ' by ' + comment.thesislink.author email_text += (', has been rejected for the following reason: ' + comment_refusal_dict[comment.status] + '.' + '\n\nWe copy it below for your convenience.' + '\n\nThank you for your contribution, \nThe SciPost Team.') diff --git a/submissions/models.py b/submissions/models.py index 17aff76b7..107e98f1d 100644 --- a/submissions/models.py +++ b/submissions/models.py @@ -54,7 +54,7 @@ class Submission(models.Model): header = '<table>' header += '<tr><td>Title: </td><td> </td><td>' + self.title + '</td></tr>' header += '<tr><td>Author(s): </td><td> </td><td>' + self.author_list + '</td></tr>' - header += '<tr><td>arxiv Link: </td><td> </td><td><a href="' + self.arxiv_link + '">' + self.arxiv_link + '</a></td></tr>' + header += '<tr><td>arxiv Link: </td><td> </td><td><a href="' + self.arxiv_link + '" target="_blank">' + self.arxiv_link + '</a></td></tr>' header += '<tr><td>Date submitted: </td><td> </td><td>' + str(self.submission_date) + '</td></tr>' header += '<tr><td>Submitted by: </td><td> </td><td>' + str(self.submitted_by) + '</td></tr>' header += '<tr><td>Submitted to: </td><td> </td><td>' + journals_submit_dict[self.submitted_to_journal] + '</td></tr>' diff --git a/theses/models.py b/theses/models.py index 762fc668d..0474b7b64 100644 --- a/theses/models.py +++ b/theses/models.py @@ -49,7 +49,7 @@ class ThesisLink(models.Model): header += '<tr><td>Discipline: </td><td></td><td>' + disciplines_dict[self.discipline] + '</td></tr>' header += '<tr><td>Domain: </td><td></td><td>' + journals_domains_dict[self.domain] + '</td></tr>' header += '<tr><td>Specialization: </td><td></td><td>' + journals_spec_dict[self.specialization] + '</td></tr>' - header += '<tr><td>URL: </td><td> </td><td><a href="' + self.pub_link + '">' + self.pub_link + '</a></td></tr>' + header += '<tr><td>URL: </td><td> </td><td><a href="' + self.pub_link + '" target="_blank">' + self.pub_link + '</a></td></tr>' header += '<tr><td>Degree granting institution: </td><td> </td><td>' + self.institution + '</td></tr>' header += '<tr><td>Supervisor(s): </td><td></td><td>' + self.supervisor + '</td></tr>' header += '<tr><td>Defense date: </td><td> </td><td>' + str(self.defense_date) + '</td></tr>' -- GitLab