Skip to content

Commit ec57140

Browse files
committed
Fixed a base64 bytes/str issue.
- Legacy-Id: 16415
1 parent 4368e8c commit ec57140

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

ietf/ipr/mail.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import re
1010

1111
from django.template.loader import render_to_string
12+
from django.utils.encoding import force_text
1213

1314
import debug # pyflakes:ignore
1415

@@ -96,7 +97,7 @@ def get_reply_to():
9697
address with "plus addressing" using a random string. Guaranteed to be unique"""
9798
local,domain = get_base_ipr_request_address().split('@')
9899
while True:
99-
rand = base64.urlsafe_b64encode(os.urandom(12))
100+
rand = force_text(base64.urlsafe_b64encode(os.urandom(12)))
100101
address = "{}+{}@{}".format(local,rand,domain)
101102
q = Message.objects.filter(reply_to=address)
102103
if not q:

0 commit comments

Comments
 (0)