mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-03 01:41:05 -05:00
Forgot to make the id unique
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import random
|
||||
|
||||
import botocore
|
||||
from boto3 import resource
|
||||
from datetime import (datetime)
|
||||
@@ -266,7 +268,9 @@ def build_dvla_file(self, job_id):
|
||||
file = ""
|
||||
for n in notifications:
|
||||
t = {"content": n.template.content, "subject": n.template.subject}
|
||||
template = LetterDVLATemplate(t, n.personalisation, 1)
|
||||
# This unique id is a 7 digits requested by DVLA, not known if this number needs to be sequential.
|
||||
unique_id = int(''.join(map(str, random.sample(range(9), 7))))
|
||||
template = LetterDVLATemplate(t, n.personalisation, unique_id)
|
||||
# print(str(template))
|
||||
file = file + str(template) + "\n"
|
||||
s3upload(filedata=file,
|
||||
|
||||
Reference in New Issue
Block a user