Skip to content

Commit

Permalink
project publish bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shayanaijaz committed Nov 25, 2024
1 parent efee296 commit de6d2e1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand Down Expand Up @@ -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.
"""
Expand Down
6 changes: 4 additions & 2 deletions server/portal/apps/publications/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit de6d2e1

Please sign in to comment.