diff --git a/server/portal/apps/projects/workspace_operations/project_publish_operations.py b/server/portal/apps/projects/workspace_operations/project_publish_operations.py index bbcc86031..1d8a83fff 100644 --- a/server/portal/apps/projects/workspace_operations/project_publish_operations.py +++ b/server/portal/apps/projects/workspace_operations/project_publish_operations.py @@ -259,7 +259,7 @@ def get_project_user_emails(project_id): @shared_task(bind=True, queue='default') -def send_publication_accept_email(project_id): +def send_publication_accept_email(self, project_id): """ Alert project authors that their request has been accepted. """ @@ -290,7 +290,7 @@ def send_publication_accept_email(project_id): @shared_task(bind=True, queue='default') -def send_publication_reject_email(project_id: str, version: Optional[int], error: str): +def send_publication_reject_email(self, project_id: str, version: Optional[int], error: str): """ Alert project authors that their request has been rejected. """ diff --git a/server/portal/apps/publications/views.py b/server/portal/apps/publications/views.py index 2eab42e1f..f4f17397c 100644 --- a/server/portal/apps/publications/views.py +++ b/server/portal/apps/publications/views.py @@ -220,7 +220,8 @@ def post(self, request): if not full_project_id: raise ApiException("Missing project ID", status=400) - send_publication_accept_email.apply_async(args=[full_project_id]) + if not settings.DEBUG: + send_publication_accept_email.apply_async(args=[full_project_id]) if is_review: project_id = full_project_id.split(f"{settings.PORTAL_PROJECTS_REVIEW_SYSTEM_PREFIX}.")[1] @@ -316,7 +317,8 @@ def post(self, request): if not full_project_id: raise ApiException("Missing project ID", status=400) - send_publication_reject_email.apply_async(args=[full_project_id]) + if not settings.DEBUG: + send_publication_reject_email.apply_async(args=[full_project_id]) update_and_cleanup_review_project(full_project_id, PublicationRequest.Status.REJECTED)