diff --git a/scipost_django/submissions/templates/submissions/_submission_status.html b/scipost_django/submissions/templates/submissions/_submission_status.html index eb95e1427304f207ce15e931592cd77f4b17e15e..efe25d4a2328df7921db71ca29a7d1e4eb46470b 100644 --- a/scipost_django/submissions/templates/submissions/_submission_status.html +++ b/scipost_django/submissions/templates/submissions/_submission_status.html @@ -17,7 +17,7 @@ <span class="label label-secondary">{{ submission.get_status_display }}</span> </div> - {% if is_submission_fellow and submission.status == "seeking_assignment" %} + {% if can_read_editorial_information and submission.status == "seeking_assignment" %} <section class="p-2 bg-primary bg-opacity-10"> <p>This paper is still seeking assignment. Appraise this paper?</p> <div id="submission-{{ submission.id }}-appraisal" class="mb-0"> diff --git a/scipost_django/submissions/views/__init__.py b/scipost_django/submissions/views/__init__.py index f8c4626a3554154aeb97ad601397c9bb0ce57543..192fbe284c31f61fb576650fc44090108509c957 100644 --- a/scipost_django/submissions/views/__init__.py +++ b/scipost_django/submissions/views/__init__.py @@ -676,10 +676,15 @@ def submission_detail(request, identifier_w_vn_nr): # their permission level is. context["can_read_editorial_information"] = False else: - # User may read eg. Editorial Recommendations if they are in the Fellowship. - context["can_read_editorial_information"] = submission.fellows.filter( - contributor__user=request.user - ).exists() + # User may read eg. Editorial Recommendations if they are in the Fellowship + # and they have no competing interests against the authors of the Submission. + context["can_read_editorial_information"] = ( + submission.fellows.without_competing_interests_against_submission_authors_of( + submission + ) + .filter(contributor__user=request.user) + .exists() + ) # User may also read eg. Editorial Recommendations if they are editorial administrator. if not context["can_read_editorial_information"]: @@ -696,6 +701,15 @@ def submission_detail(request, identifier_w_vn_nr): recommendations = submission.eicrecommendations.active() + has_appraised_submission = ( + submission.qualification_set.filter( + fellow__contributor__user=request.user.id + ).exists() + and submission.readiness_set.filter( + fellow__contributor__user=request.user.id + ).exists() + ) + context.update( { "submission": submission, @@ -707,6 +721,7 @@ def submission_detail(request, identifier_w_vn_nr): "is_author": is_author, "is_author_unchecked": is_author_unchecked, "is_submission_fellow": is_submission_fellow, + "has_appraised_submission": has_appraised_submission, } ) return render(request, "submissions/submission_detail.html", context)