give test letter api notifications a different filename

so they can be distinguished on the frontend.

Also, some related cleanup:

* don't show test api letters on the frontpage
* make sure the subject is returned from the API for letters
* make sure the letter's address is returned for letters
This commit is contained in:
Leo Hemsted
2017-08-01 18:23:29 +01:00
parent 075d2a3346
commit 13917c9c57
6 changed files with 45 additions and 8 deletions

View File

@@ -3,6 +3,7 @@ from app.models import LETTER_TYPE, JOB_STATUS_READY_TO_SEND, Job
from app.dao.jobs_dao import dao_create_job
from app.notifications.process_notifications import persist_notification
from app.v2.errors import InvalidRequest
from app.variables import LETTER_API_FILENAME
def create_letter_api_job(template):
@@ -13,7 +14,7 @@ def create_letter_api_job(template):
raise InvalidRequest('Template {} is deleted'.format(template.id), 400)
job = Job(
original_file_name='letter submitted via api',
original_file_name=LETTER_API_FILENAME,
service=service,
template=template,
template_version=template.version,