mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Add cloudfoundry config values
also added tests
This commit is contained in:
@@ -8,15 +8,14 @@ class TemplatePreview:
|
||||
@classmethod
|
||||
def from_database_object(cls, template, filetype, values=None):
|
||||
data = {
|
||||
"letter_contact_block": current_service['letter_contact_block'],
|
||||
"admin_base_url": current_app.config['ADMIN_BASE_URL'],
|
||||
"template": template,
|
||||
"values": values
|
||||
'letter_contact_block': current_service['letter_contact_block'],
|
||||
'template': template,
|
||||
'values': values
|
||||
}
|
||||
resp = requests.post(
|
||||
'{}/preview.{}'.format(current_app.config['TEMPLATE_PREVIEW_SERVICE_URL'], filetype),
|
||||
'{}/preview.{}'.format(current_app.config['TEMPLATE_PREVIEW_API_HOST'], filetype),
|
||||
json=data,
|
||||
headers={'Authorization': 'Token my-secret-key'}
|
||||
headers={'Authorization': 'Token {}'.format(current_app.config['TEMPLATE_PREVIEW_API_KEY'])}
|
||||
)
|
||||
return (resp.content, resp.status_code, resp.headers.items())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user