summaryrefslogtreecommitdiffstats
path: root/store/authdecorators.py
diff options
context:
space:
mode:
Diffstat (limited to 'store/authdecorators.py')
-rw-r--r--store/authdecorators.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/store/authdecorators.py b/store/authdecorators.py
index 2a4119c..a4307ff 100644
--- a/store/authdecorators.py
+++ b/store/authdecorators.py
@@ -60,7 +60,7 @@ def view_or_basicauth(view, request, test_func, realm="", *args, **kwargs):
# NOTE: We are only support basic authentication for now.
#
if auth[0].lower() == "basic":
- uname, passwd = base64.b64decode(auth[1]).split(':')
+ uname, passwd = base64.b64decode(auth[1].encode('utf-8')).decode('utf-8').split(':')
user = authenticate(username=uname, password=passwd)
if user is not None:
if user.is_active:
@@ -114,7 +114,7 @@ def logged_in_or_basicauth(realm=""):
def view_decorator(func):
def wrapper(request, *args, **kwargs):
return view_or_basicauth(func, request,
- lambda u: u.is_authenticated(),
+ lambda u: u.is_authenticated,
realm, *args, **kwargs)
return wrapper