mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-01 04:09:46 -04:00
Merge pull request #3450 from alphagov/non-ascii-metadata
Non ascii metadata
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import base64
|
||||
import itertools
|
||||
import json
|
||||
import urllib
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from functools import partial
|
||||
@@ -255,14 +254,12 @@ def _get_error_from_upload_form(form_errors):
|
||||
def format_recipient(address):
|
||||
'''
|
||||
To format the recipient we need to:
|
||||
- decode, address is url encoded
|
||||
- remove new line characters
|
||||
- remove whitespace around the lines
|
||||
- join the address lines, separated by a comma
|
||||
'''
|
||||
if not address:
|
||||
return address
|
||||
address = urllib.parse.unquote(address)
|
||||
stripped_address_lines_no_trailing_commas = [
|
||||
line.lstrip().rstrip(' ,')
|
||||
for line in address.splitlines() if line
|
||||
|
||||
Reference in New Issue
Block a user