More refactors

- single base method to send notifications
- knows about service id (present if job based)
- knows about jobs - if needed
- knows about type

Does the right thing

Was lots of shared code around error checking now in one place.
This commit is contained in:
Martyn Inglis
2016-02-24 09:55:05 +00:00
parent 0007c69972
commit b0609b1813
4 changed files with 61 additions and 48 deletions

View File

@@ -45,6 +45,7 @@ def send_email(service_id, notification_id, subject, from_address, encrypted_not
template_id=notification['template'],
to=notification['to'],
service_id=service_id,
job_id=notification.get('job', None),
status='sent'
)
save_notification(notification_db_object)