mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
Changed styling
This commit is contained in:
@@ -444,12 +444,12 @@ def is_delivery_slow_for_provider(
|
|||||||
@statsd(namespace="dao")
|
@statsd(namespace="dao")
|
||||||
@transactional
|
@transactional
|
||||||
def dao_update_notifications_sent_to_dvla(job_id, provider):
|
def dao_update_notifications_sent_to_dvla(job_id, provider):
|
||||||
updated_count = db.session.query(Notification
|
updated_count = db.session.query(
|
||||||
).filter(Notification.job_id == job_id
|
Notification).filter(Notification.job_id == job_id).update(
|
||||||
).update({'status': 'sending', "sent_by": provider})
|
{'status': 'sending', "sent_by": provider})
|
||||||
|
|
||||||
db.session.query(NotificationHistory
|
db.session.query(
|
||||||
).filter(NotificationHistory.job_id == job_id
|
NotificationHistory).filter(NotificationHistory.job_id == job_id).update(
|
||||||
).update({'status': 'sending', "sent_by": provider})
|
{'status': 'sending', "sent_by": provider})
|
||||||
|
|
||||||
return updated_count
|
return updated_count
|
||||||
|
|||||||
+2
-2
@@ -283,8 +283,8 @@ class JobSchema(BaseSchema):
|
|||||||
job_status = field_for(models.JobStatus, 'name', required=False)
|
job_status = field_for(models.JobStatus, 'name', required=False)
|
||||||
|
|
||||||
scheduled_for = fields.DateTime()
|
scheduled_for = fields.DateTime()
|
||||||
service_name = fields.Nested(ServiceSchema, attribute="service", dump_to="service_name", only=["name"],
|
service_name = fields.Nested(
|
||||||
dump_only=True)
|
ServiceSchema, attribute="service", dump_to="service_name", only=["name"], dump_only=True)
|
||||||
|
|
||||||
@validates('scheduled_for')
|
@validates('scheduled_for')
|
||||||
def validate_scheduled_for(self, value):
|
def validate_scheduled_for(self, value):
|
||||||
|
|||||||
@@ -1571,8 +1571,8 @@ def test_dao_update_notifications_sent_to_dvla(notify_db, notify_db_session, sam
|
|||||||
def test_dao_update_notifications_sent_to_dvla_does_update_history_if_test_key(
|
def test_dao_update_notifications_sent_to_dvla_does_update_history_if_test_key(
|
||||||
notify_db, notify_db_session, sample_letter_template, sample_api_key):
|
notify_db, notify_db_session, sample_letter_template, sample_api_key):
|
||||||
job = sample_job(notify_db=notify_db, notify_db_session=notify_db_session, template=sample_letter_template)
|
job = sample_job(notify_db=notify_db, notify_db_session=notify_db_session, template=sample_letter_template)
|
||||||
notification = create_notification(template=sample_letter_template, job=job, api_key_id=sample_api_key.id,
|
notification = create_notification(
|
||||||
key_type='test')
|
template=sample_letter_template, job=job, api_key_id=sample_api_key.id, key_type='test')
|
||||||
|
|
||||||
updated_count = dao_update_notifications_sent_to_dvla(job_id=job.id, provider='some provider')
|
updated_count = dao_update_notifications_sent_to_dvla(job_id=job.id, provider='some provider')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user