diff --git a/submissions/utils.py b/submissions/utils.py index 36c315eb0f804c224c32d3224ba3ad8ea98cbc03..8eb67fc8ad775e072c97c5c7c0ba36c976cf84d6 100644 --- a/submissions/utils.py +++ b/submissions/utils.py @@ -72,7 +72,7 @@ class SubmissionUtils(object): '\n\nhas successfully passed the pre-screening stage. ' '\n\nA Submission Page has been activated at ' 'https://scipost.org/submission/' + str(cls.assignment.submission.id) + - 'and a refereeing round has been started, with deadline ' + ' and a refereeing round has been started, with deadline ' 'currently set at ' + datetime.datetime.strftime(cls.assignment.submission.reporting_deadline, "%Y-%m-%d") + '. ' '\n\nWe thank you very much for your contribution.' diff --git a/submissions/views.py b/submissions/views.py index 486b8b6162d676e62dcb141fa1785c16f8b8a656..86964e9c5cce590c070f64aae2c18e427e3c8c7f 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -235,10 +235,14 @@ def submission_detail(request, submission_id): except Comment.DoesNotExist: author_replies = () # To check in template whether the user can submit a report: - is_author = request.user.contributor in submission.authors.all() - is_author_unchecked = (not is_author - and not (request.user.contributor in submission.authors_false_claims.all()) - and (request.user.last_name in submission.author_list)) + try: + is_author = request.user.contributor in submission.authors.all() + is_author_unchecked = (not is_author + and not (request.user.contributor in submission.authors_false_claims.all()) + and (request.user.last_name in submission.author_list)) + except AttributeError: + is_author = False + is_author_unchecked = False context = {'submission': submission, 'comments': comments.filter(status__gte=1, is_author_reply=False).order_by('-date_submitted'), 'invited_reports': reports.filter(status__gte=1, invited=True), 'contributed_reports': reports.filter(status__gte=1, invited=False),