From 5a58664f5cf03995c6f35f71812cfcf5637ba76e Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Wed, 7 Jul 2010 22:15:37 +0200 Subject: break out nonce and anonymous id methods - they need better implementations --- coip/apps/auth/utils.py | 5 ++++- coip/apps/auth/views.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'coip/apps/auth') diff --git a/coip/apps/auth/utils.py b/coip/apps/auth/utils.py index b7bb044..9e0a736 100644 --- a/coip/apps/auth/utils.py +++ b/coip/apps/auth/utils.py @@ -6,4 +6,7 @@ Created on Jul 7, 2010 from uuid import uuid4 def nonce(): - return uuid4().hex; \ No newline at end of file + return uuid4().hex; + +def anonid(): + return uuid4().urn; \ No newline at end of file diff --git a/coip/apps/auth/views.py b/coip/apps/auth/views.py index 3e54e9c..d38be1f 100644 --- a/coip/apps/auth/views.py +++ b/coip/apps/auth/views.py @@ -6,7 +6,7 @@ Created on Jul 5, 2010 from django.http import HttpResponseRedirect from coip.apps.userprofile.models import UserProfile from django.contrib.auth.models import User -from uuid import uuid4 +from coip.apps.auth.utils import anonid def meta(request,attr): v = request.META.get(attr) @@ -20,7 +20,7 @@ def accounts_login_federated(request): request.user = profile.user else: profile.identifier = request.user.username - request.user = User(username=uuid4().urn) + request.user = User(username=anonid()) request.user.save() profile.user = request.user -- cgit v1.1