mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-21 07:51:13 -05:00
refer to file rather than document
Karl Approved™
This commit is contained in:
@@ -39,7 +39,7 @@ def get_pdf_for_notification(notification_id):
|
|||||||
raise BadRequestError(message="Notification is not a letter")
|
raise BadRequestError(message="Notification is not a letter")
|
||||||
|
|
||||||
if notification.status == NOTIFICATION_VIRUS_SCAN_FAILED:
|
if notification.status == NOTIFICATION_VIRUS_SCAN_FAILED:
|
||||||
raise BadRequestError(message='Document did not pass the virus scan')
|
raise BadRequestError(message='File did not pass the virus scan')
|
||||||
|
|
||||||
if notification.status == NOTIFICATION_TECHNICAL_FAILURE:
|
if notification.status == NOTIFICATION_TECHNICAL_FAILURE:
|
||||||
raise BadRequestError(message='PDF not available for letters in status {}'.format(notification.status))
|
raise BadRequestError(message='PDF not available for letters in status {}'.format(notification.status))
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ def create_notification(
|
|||||||
updated_at = updated_at or datetime.utcnow()
|
updated_at = updated_at or datetime.utcnow()
|
||||||
|
|
||||||
if not one_off and (job is None and api_key is None):
|
if not one_off and (job is None and api_key is None):
|
||||||
# we didn't specify in test - lets create it
|
# we did not specify in test - lets create it
|
||||||
api_key = ApiKey.query.filter(ApiKey.service == template.service, ApiKey.key_type == key_type).first()
|
api_key = ApiKey.query.filter(ApiKey.service == template.service, ApiKey.key_type == key_type).first()
|
||||||
if not api_key:
|
if not api_key:
|
||||||
api_key = create_api_key(template.service, key_type=key_type)
|
api_key = create_api_key(template.service, key_type=key_type)
|
||||||
|
|||||||
@@ -703,7 +703,7 @@ def test_get_pdf_for_notification_returns_400_if_pdf_not_found(
|
|||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('status, expected_message', [
|
@pytest.mark.parametrize('status, expected_message', [
|
||||||
('virus-scan-failed', 'Document did not pass the virus scan'),
|
('virus-scan-failed', 'File did not pass the virus scan'),
|
||||||
('technical-failure', 'PDF not available for letters in status technical-failure'),
|
('technical-failure', 'PDF not available for letters in status technical-failure'),
|
||||||
])
|
])
|
||||||
def test_get_pdf_for_notification_only_returns_pdf_content_if_right_status(
|
def test_get_pdf_for_notification_only_returns_pdf_content_if_right_status(
|
||||||
|
|||||||
Reference in New Issue
Block a user