[ckan-changes] commit/ckanextiati: sebbacon: make it work for anon users

Bitbucket commits-noreply at bitbucket.org
Wed Jun 8 13:46:46 UTC 2011


1 new changeset in ckanextiati:

http://bitbucket.org/okfn/ckanextiati/changeset/3903209fd7d2/
changeset:   3903209fd7d2
user:        sebbacon
date:        2011-06-08 15:46:18
summary:     make it work for anon users
affected #:  1 file (25 bytes)

--- a/ckanext/iati/patch.py	Wed Jun 08 14:33:13 2011 +0100
+++ b/ckanext/iati/patch.py	Wed Jun 08 14:46:18 2011 +0100
@@ -46,7 +46,8 @@
     return True
 
 def my_group():
-    authzgroups = model.User.by_name(c.user).authorization_groups
+    user = model.User.by_name(c.user)
+    authzgroups = user and user.authorization_groups
     authzgroup = authzgroups and authzgroups[0]
     if authzgroup:
         group_id = re.match(r"group-(.*)-authz", authzgroup.name).group(1)

Repository URL: https://bitbucket.org/okfn/ckanextiati/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list