Changed styling

This commit is contained in:
Rebecca Law
2017-04-07 14:36:00 +01:00
parent 5a810a47ac
commit 2d9a449d1e
5 changed files with 23 additions and 23 deletions

View File

@@ -308,18 +308,18 @@ def update_job_to_sent_to_dvla(self, job_id):
def create_dvla_file_contents(job_id):
file_contents = '\n'.join(
str(LetterDVLATemplate(
notification.template.__dict__,
notification.personalisation,
# This unique id is a 7 digits requested by DVLA, not known
# if this number needs to be sequential.
numeric_id=random.randint(1, int('9' * 7)),
contact_block=notification.service.letter_contact_block,
))
for notification in dao_get_all_notifications_for_job(job_id)
)
return file_contents
file_contents = '\n'.join(
str(LetterDVLATemplate(
notification.template.__dict__,
notification.personalisation,
# This unique id is a 7 digits requested by DVLA, not known
# if this number needs to be sequential.
numeric_id=random.randint(1, int('9' * 7)),
contact_block=notification.service.letter_contact_block,
))
for notification in dao_get_all_notifications_for_job(job_id)
)
return file_contents
def s3upload(filedata, region, bucket_name, file_location):

View File

@@ -444,12 +444,12 @@ def is_delivery_slow_for_provider(
@statsd(namespace="dao")
@transactional
def dao_update_notifications_sent_to_dvla(job_id, provider):
updated_count = db.session.query(Notification
).filter(Notification.job_id == job_id
).update({'status': 'sending', "sent_by": provider})
updated_count = db.session.query(
Notification).filter(Notification.job_id == job_id).update(
{'status': 'sending', "sent_by": provider})
db.session.query(NotificationHistory
).filter(NotificationHistory.job_id == job_id
).update({'status': 'sending', "sent_by": provider})
db.session.query(
NotificationHistory).filter(NotificationHistory.job_id == job_id).update(
{'status': 'sending', "sent_by": provider})
return updated_count

View File

@@ -283,8 +283,8 @@ class JobSchema(BaseSchema):
job_status = field_for(models.JobStatus, 'name', required=False)
scheduled_for = fields.DateTime()
service_name = fields.Nested(ServiceSchema, attribute="service", dump_to="service_name", only=["name"],
dump_only=True)
service_name = fields.Nested(
ServiceSchema, attribute="service", dump_to="service_name", only=["name"], dump_only=True)
@validates('scheduled_for')
def validate_scheduled_for(self, value):