* Changes to allow json to call the method.
* Switch to returning the group information via jsonProps instead of as a separate value.
This commit is contained in:
parent
1ae9e6f266
commit
061fcaaba6
2 changed files with 6 additions and 3 deletions
|
@ -45,7 +45,7 @@
|
|||
</ul>
|
||||
-->
|
||||
<ul id="rolespanel" py:if="personal">
|
||||
<py:for each="group in sorted(groups)">
|
||||
<py:for each="group in sorted(person.memberships)">
|
||||
<li py:if="auth.canViewGroup(person, group)" class="role">
|
||||
<h4>${group.display_name}</h4> (${group.group_type})
|
||||
<dl>
|
||||
|
|
|
@ -154,7 +154,7 @@ class User(controllers.Controller):
|
|||
@identity.require(turbogears.identity.not_anonymous())
|
||||
@validate(validators=UserView())
|
||||
@error_handler(error)
|
||||
@expose(template="fas.templates.user.view")
|
||||
@expose(template="fas.templates.user.view", allow_json=True)
|
||||
def view(self, username=None):
|
||||
'''View a User.
|
||||
'''
|
||||
|
@ -178,7 +178,10 @@ class User(controllers.Controller):
|
|||
cla = 'clicked'
|
||||
if signedCLAPrivs(person):
|
||||
cla = 'signed'
|
||||
return dict(person=person, groups=groups, cla=cla, personal=personal, admin=admin)
|
||||
person.jsonProps = {
|
||||
'People': ('approved_memberships', 'unapproved_memberships')
|
||||
}
|
||||
return dict(person=person, cla=cla, personal=personal, admin=admin)
|
||||
|
||||
@identity.require(turbogears.identity.not_anonymous())
|
||||
@validate(validators=UserEdit())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue