diff --git a/.env.example b/.env.example index 0f0ca32848..45389f2a0c 100644 --- a/.env.example +++ b/.env.example @@ -23,6 +23,10 @@ CONTACT_EMAIL='PhysioNet Contact ' SERVER_EMAIL='PhysioNet System ' ERROR_EMAIL='contact@physionet.org' +# Contact address for project editors. This address may be viewable by authors. +# Optionally, add "PROJECT-SLUG" to include the project slug. +PROJECT_EDITOR_EMAIL='editor+PROJECT-SLUG@dev.physionet.org' + # Admins ADMINS_NAME=PhysioNet Technical ADMINS_MAIL=technical@dev.physionet.org diff --git a/physionet-django/physionet/settings/base.py b/physionet-django/physionet/settings/base.py index 65224c7308..3971ca8c10 100644 --- a/physionet-django/physionet/settings/base.py +++ b/physionet-django/physionet/settings/base.py @@ -640,3 +640,6 @@ class StorageTypes: # Django configuration for file upload (see https://docs.djangoproject.com/en/4.2/ref/settings/) DATA_UPLOAD_MAX_NUMBER_FILES = config('DATA_UPLOAD_MAX_NUMBER_FILES', cast=int, default=1000) DATA_UPLOAD_MAX_MEMORY_SIZE = config('DATA_UPLOAD_MAX_MEMORY_SIZE', cast=int, default=2621440) + +# Emails +PROJECT_EDITOR_EMAIL = config('PROJECT_EDITOR_EMAIL', default='') diff --git a/physionet-django/project/templates/project/active_submission_timeline.html b/physionet-django/project/templates/project/active_submission_timeline.html index 9c6a09943d..63b549e224 100644 --- a/physionet-django/project/templates/project/active_submission_timeline.html +++ b/physionet-django/project/templates/project/active_submission_timeline.html @@ -192,7 +192,7 @@
  • {{ project.editor_assignment_datetime|date }}
    -
    The project was assigned to an editor: {{ project.editor.disp_name_email }} +
    The project was assigned to an editor. To contact the editor, email:
    {{ contact_email }}
  • {% endif %} diff --git a/physionet-django/project/views.py b/physionet-django/project/views.py index e8968e0523..ccaf51227d 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1388,11 +1388,26 @@ def project_submission(request, project_slug, **kwargs): else: edit_logs, copyedit_logs = None, None - return render(request, 'project/project_submission.html', { - 'project':project, 'authors':authors, - 'is_submitting':is_submitting, 'author_comments_form':author_comments_form, - 'edit_logs':edit_logs, 'copyedit_logs':copyedit_logs, - 'awaiting_user_approval':awaiting_user_approval}) + if settings.PROJECT_EDITOR_EMAIL: + contact_email = settings.PROJECT_EDITOR_EMAIL.replace('PROJECT-SLUG', + project.slug) + else: + contact_email = project.editor.email + + return render( + request, + "project/project_submission.html", + { + "project": project, + "authors": authors, + "is_submitting": is_submitting, + "author_comments_form": author_comments_form, + "edit_logs": edit_logs, + "copyedit_logs": copyedit_logs, + "awaiting_user_approval": awaiting_user_approval, + "contact_email": contact_email, + }, + ) @project_auth(auth_mode=0, post_auth_mode=2)