diff --git a/submissions/templates/partials/submissions/pool/submission_info_table.html b/submissions/templates/partials/submissions/pool/submission_info_table.html index 3594325cb2603b6fa8e0a1f976bce104afc02848..cd0e04b4e03c2ba7305b7dba429e7848325d39c7 100644 --- a/submissions/templates/partials/submissions/pool/submission_info_table.html +++ b/submissions/templates/partials/submissions/pool/submission_info_table.html @@ -42,7 +42,7 @@ {% elif perms.scipost.can_assign_submissions %} <a href="{% url 'submissions:assign_submission' submission.preprint.identifier_w_vn_nr %}">Send a new assignment request</a> {% else %} - <strong class="text-danger">You can volunteer to become Editor-in-charge by <a href="{% url 'submissions:volunteer_as_EIC' submission.preprint.identifier_w_vn_nr %}">clicking here</a>.</strong> + <strong class="text-danger">You can volunteer to become Editor-in-charge by <a href="{% url 'submissions:editorial_assignment' submission.preprint.identifier_w_vn_nr %}">clicking here</a>.</strong> {% endif %} </td> </tr> diff --git a/submissions/urls.py b/submissions/urls.py index 5591c3ff0cb1661be5172ecc0563d6057c21da2e..443848c1d4ec5c8e0086c59a45a9e4ba95acbb4e 100644 --- a/submissions/urls.py +++ b/submissions/urls.py @@ -92,8 +92,6 @@ urlpatterns = [ url(r'^pool/{regex}/editorial_assignment/(?P<assignment_id>[0-9]+)/$'.format( regex=SUBMISSIONS_COMPLETE_REGEX), views.editorial_assignment, name='editorial_assignment'), - url(r'^volunteer_as_EIC/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), - views.volunteer_as_EIC, name='volunteer_as_EIC'), url(r'^assignment_failed/{regex}$'.format(regex=SUBMISSIONS_COMPLETE_REGEX), views.assignment_failed, name='assignment_failed'), # Editorial workflow and refereeing diff --git a/submissions/views.py b/submissions/views.py index 6123073104dbd088eab89479801ed7feda6457ae..e33312b7edadedcac005e550c2c91f437d8a9246 100644 --- a/submissions/views.py +++ b/submissions/views.py @@ -726,72 +726,6 @@ def assignment_request(request, assignment_id): })) -@login_required -@fellowship_required() -@transaction.atomic -def volunteer_as_EIC(request, identifier_w_vn_nr): - """Single click action to take charge of a Submission. - - Called when a Fellow volunteers while perusing the submissions pool. - This is an adapted version of the assignment_request method. - """ - submission = get_object_or_404(Submission.objects.pool(request.user), - preprint__identifier_w_vn_nr=identifier_w_vn_nr) - errormessage = None - if submission.status == STATUS_ASSIGNMENT_FAILED: - errormessage = '<h3>Thank you for considering.</h3>' - errormessage += 'This Submission has failed pre-screening and has been rejected.' - elif submission.editor_in_charge: - errormessage = '<h3>Thank you for considering.</h3>' - errormessage += (submission.editor_in_charge.get_title_display() + ' ' + - submission.editor_in_charge.user.last_name + - ' has already agreed to be Editor-in-charge of this Submission.') - elif not hasattr(request.user, 'contributor'): - errormessage = ( - 'You do not have an activated Contributor account. Therefore, you cannot take charge.') - - if errormessage: - messages.warning(request, errormessage) - return redirect(reverse('submissions:pool')) - - contributor = request.user.contributor - # The Contributor may already have an EditorialAssignment due to an earlier invitation. - assignment, __ = EditorialAssignment.objects.get_or_create( - submission=submission, to=contributor) - # Explicitly update afterwards, since update_or_create does not properly do the job. - EditorialAssignment.objects.filter(id=assignment.id).update( - status=STATUS_ACCEPTED, date_answered=timezone.now()) - - # Set deadlines - deadline = timezone.now() + submission.submitted_to.refereeing_period - - # Update Submission data - Submission.objects.filter(id=submission.id).update( - status=STATUS_EIC_ASSIGNED, - editor_in_charge=contributor, - open_for_reporting=True, - reporting_deadline=deadline, - open_for_commenting=True, - latest_activity=timezone.now()) - - # Deprecate old Editorial Assignments - EditorialAssignment.objects.filter(submission=submission).invited().update( - status=STATUS_DEPRECATED) - - # Send emails to EIC and authors regarding the EIC assignment. - assignment = EditorialAssignment.objects.get(id=assignment.id) # Update before use in mail - SubmissionUtils.load({'assignment': assignment}) - SubmissionUtils.send_EIC_appointment_email() - SubmissionUtils.send_author_prescreening_passed_email() - - # Add SubmissionEvents - submission.add_general_event('The Editor-in-charge has been assigned.') - - messages.success(request, 'Thank you for becoming Editor-in-charge of this submission.') - return redirect(reverse('submissions:editorial_page', - args=[submission.preprint.identifier_w_vn_nr])) - - @login_required @permission_required('scipost.can_assign_submissions', raise_exception=True) @transaction.atomic