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

@@ -338,7 +338,8 @@ def get_notifications_for_service(
filters.append(Notification.created_at < older_than_created_at)
if not include_jobs or (key_type and key_type != KEY_TYPE_NORMAL):
filters.append(Notification.job_id.is_(None))
# we can't say "job_id == None" here, because letters sent via the API still have a job_id :(
filters.append(Notification.api_key_id != None) # noqa
if key_type is not None:
filters.append(Notification.key_type == key_type)