From fc22228e4502968af7929ccc2d531d9cfdb75aeb Mon Sep 17 00:00:00 2001
From: Ben Adida <ben@adida.net>
Date: Mon, 25 Jan 2021 02:20:17 +0000
Subject: [PATCH] fix: python3 bytes to string for randomness

---
 helios/views.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/helios/views.py b/helios/views.py
index b642619..26a5851 100644
--- a/helios/views.py
+++ b/helios/views.py
@@ -491,10 +491,8 @@ def get_randomness(request, election):
   get some randomness to sprinkle into the sjcl entropy pool
   """
   return {
-    # back to urandom, it's fine
-    "randomness" : base64.b64encode(os.urandom(32))
-    #"randomness" : base64.b64encode(uuid.uuid4().bytes + uuid.uuid4().bytes)
-    }
+    "randomness" : base64.b64encode(os.urandom(32)).decode('utf-8')
+  }
 
 @election_view(frozen=True)
 @return_json
-- 
GitLab