mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-11 09:27:56 -04:00
Added the random string reference to the letter
- uses the reference field on the notifications table to store a 16char random string used to cross reference DVLA letters back to the notification - used as letter barcode does not have space for a UUID notification id Depends on https://github.com/alphagov/notifications-utils/pull/149 Renamed the numeric_id to notification_reference in utils and changed validation rules to match this Note also the persist_notification method set "reference" to be "client_reference" which is confusing and they are different things, so fixed this too.
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import os
|
||||
import random
|
||||
import string
|
||||
import uuid
|
||||
|
||||
from flask import Flask, _request_ctx_stack
|
||||
@@ -204,6 +206,10 @@ def create_uuid():
|
||||
return str(uuid.uuid4())
|
||||
|
||||
|
||||
def create_random_identifier():
|
||||
return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(16))
|
||||
|
||||
|
||||
def process_user_agent(user_agent_string):
|
||||
if user_agent_string and user_agent_string.lower().startswith("notify"):
|
||||
components = user_agent_string.split("/")
|
||||
|
||||
Reference in New Issue
Block a user