Skip to content

Commit

Permalink
Merge pull request #2251 from IFRCGo/fix/fr-notif-email-url
Browse files Browse the repository at this point in the history
Cleaning up frontend URL-s from hashtag+appends
  • Loading branch information
szabozoltan69 authored Aug 30, 2024
2 parents 09b9bd2 + 1fe7090 commit e2d2b98
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions api/management/commands/index_and_notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_resource_uri(self, record, rtype):
belonging_event = (
record.event.id if record.event is not None else 57
) # Very rare – giving a non-existent | manually created surge – no event
resource_uri = "%s/emergencies/%s#surge" % (settings.FRONTEND_URL, belonging_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
elif rtype == RecordType.APPEAL and (record.event is not None and not record.needs_confirmation):
Expand Down Expand Up @@ -333,7 +333,7 @@ def get_weekly_digest_latest_deployments(self):
# 'type': 'Alert',
# 'operation': alert.operation,
# 'event_url': (
# '{}/emergencies/{}#overview'.format(settings.FRONTEND_URL, event.id) if event else
# '{}/emergencies/{}'.format(settings.FRONTEND_URL, event.id) if event else
# settings.FRONTEND_URL,
# ),
# 'society_from': '',
Expand All @@ -352,9 +352,7 @@ def get_weekly_digest_latest_deployments(self):
country_from = Country.objects.get(id=pers.country_from_id) if pers.country_from_id is not None else None
dep_to_add = {
"operation": event.name if event else "",
"event_url": (
"{}/emergencies/{}#overview".format(settings.FRONTEND_URL, event.id) if event else settings.FRONTEND_URL
),
"event_url": ("{}/emergencies/{}".format(settings.FRONTEND_URL, event.id) if event else settings.FRONTEND_URL),
"society_from": country_from.society_name if country_from else "",
"name": pers.name,
"role": pers.role,
Expand Down Expand Up @@ -597,9 +595,7 @@ def construct_template_record(self, rtype, record):
delegates += int(f.num_expats_delegates or 0)
resource_uri, follow_url = self.get_resource_uri(record, rtype), None
if resource_uri != settings.FRONTEND_URL:
# instead of '{}/account#notifications'.format(settings.FRONTEND_URL):
follow_url = resource_uri + "/follow"
resource_uri += "#overview"
rec_obj = {
"frontend_url": settings.FRONTEND_URL,
"resource_uri": resource_uri,
Expand Down

0 comments on commit e2d2b98

Please sign in to comment.