witten
/
luminotes
Archived
1
0
Fork 0

Groups.load_users() now returns info on the group itself as well.

This commit is contained in:
Dan Helfman 2008-06-02 16:03:48 -07:00
parent 23f0cbe781
commit 39ca4c619b
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class Groups( object ):
@param user_id: id of current logged-in user (if any)
@rtype: dict
@return: {
'group': group_info,
'admin_users': admin_user_list,
'other_users': non_admin_user_list,
}
@ -50,6 +51,7 @@ class Groups( object ):
other_users = self.__database.select_many( User, group.sql_load_users( admin = False ) )
return dict(
group = group,
admin_users = admin_users,
other_users = other_users,
)

View File

@ -59,6 +59,10 @@ class Test_groups( Test_controller ):
assert result[ u"other_users" ][ 1 ].object_id == self.user3.object_id
assert result[ u"other_users" ][ 1 ].username == self.user3.username
assert result[ u"group" ].object_id == self.group.object_id
assert result[ u"group" ].name == self.group.name
assert result[ u"group" ].admin == self.group.admin
def login( self ):
result = self.http_post( "/users/login", dict(
username = self.username,