Skip to content

Commit

Permalink
[QCDP24-19] update email notification
Browse files Browse the repository at this point in the history
  • Loading branch information
awset committed Sep 19, 2024
1 parent 9b79ad0 commit 9f24c77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions ckanext/datarequests/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,8 @@ def get_datarequest_followers():

case 'update_datarequest':
get_catalog_support_team()
get_datarequest_creator()
if current_user.id != datarequest['user_id']:
get_datarequest_creator()

case 'comment_datarequest':
get_catalog_support_team()
Expand Down Expand Up @@ -455,9 +456,7 @@ def update_datarequest(context, data_dict):
break

# Set the data provided by the user in the data_red
current_status = data_req.status
_undictize_datarequest_basic(data_req, data_dict)
new_status = data_req.status

# Always force datarequest to active state when updating, some older dataset may be in null state
data_req.state = model.State.ACTIVE
Expand All @@ -467,12 +466,9 @@ def update_datarequest(context, data_dict):

datarequest_dict = _dictize_datarequest(data_req)

if current_status != new_status:
_send_mail('update_datarequest', datarequest_dict, 'Data Request Status Change Email', context)
has_changes = True

# Send follower and email notifications if there is changes in the data request
if has_changes:
_send_mail('update_datarequest', datarequest_dict, 'Data Request Status Change Email', context)
_send_mail('update_datarequest_follower', datarequest_dict, 'Data Request Updated Email', context)

return datarequest_dict
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
An update on the following data access request has been submitted.
To view the status of your data access request, follow this link:
To view the data access request, follow this link:

{{ site_url }}/datarequest/{{ datarequest.id }}

Requested data: {{ datarequest.title }}
Change of status: {{ datarequest.status }}
Current of status: {{ datarequest.status }}

Do not reply to this email.

0 comments on commit 9f24c77

Please sign in to comment.