Task is the same whether job based or not

- use notification to build action
- notification has job
- based in encrypted blob
This commit is contained in:
Martyn Inglis
2016-02-23 17:39:08 +00:00
parent 635debb5a6
commit 201c2d01ba
5 changed files with 32 additions and 9 deletions

View File

@@ -9,7 +9,7 @@ from sqlalchemy.exc import SQLAlchemyError
@notify_celery.task(name="send-sms")
def send_sms(service_id, notification_id, encrypted_notification, job_id=None):
def send_sms(service_id, notification_id, encrypted_notification):
notification = encryption.decrypt(encrypted_notification)
template = get_model_templates(notification['template'])
@@ -19,7 +19,7 @@ def send_sms(service_id, notification_id, encrypted_notification, job_id=None):
template_id=notification['template'],
to=notification['to'],
service_id=service_id,
job_id=job_id,
job_id=notification.get('job', None),
status='sent'
)
save_notification(notification_db_object)