From bfdf0d97abf450b2f408d6d131f488f5973ffd73 Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Sat, 2 Dec 2023 15:20:03 -0500 Subject: [PATCH 1/3] Do not reveal the name of the editor. Ref #2117. --- .../project/active_submission_timeline.html | 2 +- physionet-django/project/views.py | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) 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..181758a85c 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1388,11 +1388,20 @@ 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}) + 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": settings.CONTACT_EMAIL, + }, + ) @project_auth(auth_mode=0, post_auth_mode=2) From cb94f4a8d8f2a7d5fc9ad2a2bfee26c1324f721d Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Wed, 10 Jan 2024 22:26:05 +0000 Subject: [PATCH 2/3] Add project editor email address to .env file. --- .env.example | 4 ++++ 1 file changed, 4 insertions(+) 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 From df16e53fb69a89ff9a718b58e29196c075037408 Mon Sep 17 00:00:00 2001 From: Tom Pollard Date: Thu, 11 Jan 2024 18:28:15 +0000 Subject: [PATCH 3/3] Display editor's email address in project submission history. --- physionet-django/physionet/settings/base.py | 3 +++ physionet-django/project/views.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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/views.py b/physionet-django/project/views.py index 181758a85c..ccaf51227d 100644 --- a/physionet-django/project/views.py +++ b/physionet-django/project/views.py @@ -1388,6 +1388,12 @@ def project_submission(request, project_slug, **kwargs): else: edit_logs, copyedit_logs = None, None + 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", @@ -1399,7 +1405,7 @@ def project_submission(request, project_slug, **kwargs): "edit_logs": edit_logs, "copyedit_logs": copyedit_logs, "awaiting_user_approval": awaiting_user_approval, - "contact_email": settings.CONTACT_EMAIL, + "contact_email": contact_email, }, )