mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-30 14:31:57 -05:00
Update utils to 12.0.0
Includes:
- [x] https://github.com/alphagov/notifications-utils/pull/94 (breaking
changes which are responsible for all the changes to the API in
this PR)
The test for `get_sms_fragment_count` has been removed because this
method is already tested in utils here:
ac20f7e99e/tests/test_base_template.py (L140-L159)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
from flask import url_for
|
||||
from app.models import SMS_TYPE, EMAIL_TYPE
|
||||
from notifications_utils.template import SMSMessageTemplate, PlainTextEmailTemplate
|
||||
|
||||
|
||||
def pagination_links(pagination, endpoint, **kwargs):
|
||||
@@ -18,3 +20,9 @@ def url_with_token(data, url, config):
|
||||
token = generate_token(data, config['SECRET_KEY'], config['DANGEROUS_SALT'])
|
||||
base_url = config['ADMIN_BASE_URL'] + url
|
||||
return base_url + token
|
||||
|
||||
|
||||
def get_template_instance(template, values):
|
||||
return {
|
||||
SMS_TYPE: SMSMessageTemplate, EMAIL_TYPE: PlainTextEmailTemplate
|
||||
}[template['template_type']](template, values)
|
||||
|
||||
Reference in New Issue
Block a user