summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeif Johansson <leifj@sunet.se>2010-12-11 23:55:51 +0100
committerLeif Johansson <leifj@sunet.se>2010-12-11 23:55:51 +0100
commit387e004818f40f2342ab3bf0e15165a2682637de (patch)
tree9a6eab9716b92ad19f852fa8fbe6a542d4004022
parent8e24e0859a4cf9f244a41c12db84b70c123987ba (diff)
profile creation isn't working
-rw-r--r--coip/apps/auth/views.py8
-rw-r--r--coip/apps/name/models.py2
-rw-r--r--templates/login.html1
3 files changed, 7 insertions, 4 deletions
diff --git a/coip/apps/auth/views.py b/coip/apps/auth/views.py
index 0539171..29b66c2 100644
--- a/coip/apps/auth/views.py
+++ b/coip/apps/auth/views.py
@@ -21,13 +21,15 @@ def meta(request,attr):
def accounts_login_federated(request):
if request.user.is_authenticated():
profile,created = UserProfile.objects.get_or_create(identifier=request.user.username)
- if profile.user:
- request.user = profile.user
- else:
+ if created:
profile.identifier = request.user.username
+ request.user.delete()
request.user = User(username=anonid())
request.user.save()
profile.user = request.user
+ else:
+ request.user = profile.user
+
update = False
cn = meta(request,'HTTP_CN')
diff --git a/coip/apps/name/models.py b/coip/apps/name/models.py
index 530775f..4de5946 100644
--- a/coip/apps/name/models.py
+++ b/coip/apps/name/models.py
@@ -137,7 +137,7 @@ class Name(models.Model):
anyuser = lookup("system:anyuser",True)
if NameLink.objects.filter(src=self,dst=anyuser,type=NameLink.access_control,data__contains=perm).count() > 0:
return True
- if NameLink.objects.filter(src=self,type=NameLink.access_control,data__contains=perm,dst__memberships__user=user).count() > 0:
+ if NameLink.objects.filter(src=self,type=NameLink.access_control,data__contains=perm,dst__membership__user=user).count() > 0:
return True
if user.is_superuser:
diff --git a/templates/login.html b/templates/login.html
index 1e5f478..03773ec 100644
--- a/templates/login.html
+++ b/templates/login.html
@@ -5,5 +5,6 @@
<h2>Welcome!</h2>
<p>This is a technology preview of coip. Please consider signing up for the coip mailing list at coip &lt;at&gt; segate.sunet.se. Note that any data you enter
into this version of coip <em>will</em> get deleted as the database is reset regularly. Stay tuned!</p>
+<p>Right now the login doesn't work - problem being investigated</p>
<a href="/accounts/login-federated">Click here to login via your own Identity Provider</a>
{% endblock %} \ No newline at end of file