mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-10 01:56:03 -04:00
Forgot to make the id unique
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import random
|
||||||
|
|
||||||
import botocore
|
import botocore
|
||||||
from boto3 import resource
|
from boto3 import resource
|
||||||
from datetime import (datetime)
|
from datetime import (datetime)
|
||||||
@@ -266,7 +268,9 @@ def build_dvla_file(self, job_id):
|
|||||||
file = ""
|
file = ""
|
||||||
for n in notifications:
|
for n in notifications:
|
||||||
t = {"content": n.template.content, "subject": n.template.subject}
|
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))
|
# print(str(template))
|
||||||
file = file + str(template) + "\n"
|
file = file + str(template) + "\n"
|
||||||
s3upload(filedata=file,
|
s3upload(filedata=file,
|
||||||
|
|||||||
Reference in New Issue
Block a user