Use utils template to format broadcast content

Brings in:
- [x] https://github.com/alphagov/notifications-utils/pull/801

Formats the content of the template at the time of creating the event.
This means that any downstream code (eg Celery tasks) can assume the
content is already formatted correctly.

Also, these downstream tasks don’t  know which template the broadcast
was created from, so if we support personalisation in the future this is
the most sensible place to bring together the template and the
personalisation.

---

I had to re-create some of the deleted code from utils for stuff like
formatting the timestamp to the CAP standard.
This commit is contained in:
Chris Hill-Scott
2020-10-26 17:39:11 +00:00
parent 55efbb0bb1
commit 28f01bd776
4 changed files with 37 additions and 11 deletions

View File

@@ -31,7 +31,7 @@ notifications-python-client==5.7.0
# PaaS
awscli-cwlogs>=1.4,<1.5
git+https://github.com/alphagov/notifications-utils.git@42.2.1#egg=notifications-utils==42.2.1
git+https://github.com/alphagov/notifications-utils.git@43.0.0#egg=notifications-utils==43.0.0
# gds-metrics requires prometheseus 0.2.0, override that requirement as 0.7.1 brings significant performance gains
prometheus-client==0.8.0
@@ -42,14 +42,14 @@ alembic==1.4.3
amqp==1.4.9
anyjson==0.3.3
attrs==20.2.0
awscli==1.18.148
awscli==1.18.164
bcrypt==3.2.0
billiard==3.3.0.23
bleach==3.1.4
blinker==1.4
boto==2.49.0
boto3==1.10.38
botocore==1.18.7
botocore==1.19.4
certifi==2020.6.20
chardet==3.0.4
click==7.1.2
@@ -66,7 +66,6 @@ importlib-metadata==2.0.0
Jinja2==2.11.2
jmespath==0.10.0
kombu==3.0.37
lxml==4.5.1
Mako==1.1.3
MarkupSafe==1.1.1
mistune==0.8.4
@@ -89,7 +88,7 @@ s3transfer==0.3.3
six==1.15.0
smartypants==2.0.1
statsd==3.3.0
urllib3==1.25.10
urllib3==1.25.11
webencodings==0.5.1
Werkzeug==1.0.1
zipp==3.2.0
zipp==3.4.0