From 3750f7d2e2c6a8309bac32f910055c65cce63227 Mon Sep 17 00:00:00 2001 From: Szabo Zoltan Date: Mon, 6 Jan 2025 16:29:54 +0100 Subject: [PATCH] Fix links in email notifications, issue 2356 --- api/management/commands/index_and_notify.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/management/commands/index_and_notify.py b/api/management/commands/index_and_notify.py index 45b53047c..e9e40ad8f 100644 --- a/api/management/commands/index_and_notify.py +++ b/api/management/commands/index_and_notify.py @@ -240,7 +240,8 @@ def get_resource_uri(self, record, rtype): ) # Very rare – giving a non-existent | manually created surge – no event resource_uri = "%s/emergencies/%s" % (settings.FRONTEND_URL, belonging_event) elif rtype == RecordType.SURGE_DEPLOYMENT_MESSAGES: - resource_uri = "%s/%s" % (settings.FRONTEND_URL, "deployments") # can be further sophisticated + resource_uri = "%s/%s" % (settings.FRONTEND_URL, "surge/overview") # could be further sophisticated: + # e.g. emergencies/6700/surge, where 6700 is the related emergency ID elif rtype == RecordType.APPEAL and (record.event is not None and not record.needs_confirmation): # Appeals with confirmed emergencies link to that emergency resource_uri = "%s/emergencies/%s" % (settings.FRONTEND_URL, record.event.id) @@ -249,7 +250,7 @@ def get_resource_uri(self, record, rtype): resource_uri = "%s/%s/%s" % ( settings.FRONTEND_URL, # this else never occurs, see ¤ - "emergencies" if rtype == RecordType.EVENT or rtype == RecordType.FOLLOWED_EVENT else "reports", + "emergencies" if rtype == RecordType.EVENT or rtype == RecordType.FOLLOWED_EVENT else "field-reports", record.id, ) return resource_uri