I actually like this code. Just issue a revert patch to my code, or,
i'll do it myself. I suggest we name the function something more
generic though. I like 'group_list' like we have 'email_list', but
anything goes.
-Yaakov
On Sun, Sep 28, 2008 at 10:32 PM, Ricky Zhou (周家杰)
<ricky(a)fedoraproject.org> wrote:
> fas/auth.py | 2 +-
> fas/json_request.py | 14 ++++++++++++++
> 2 files changed, 15 insertions(+), 1 deletion(-)
>
> New commits:
> commit cc20015bb73b0e18b91632dc452af0d8f614ab5a
> Author: Ricky Zhou <ricky(a)fedoraproject.org>
> Date: Sun Sep 28 22:32:37 2008 -0400
>
> Initial fas_client method.
>
> diff --git a/fas/auth.py b/fas/auth.py
> index 070259a..087ef2a 100644
> --- a/fas/auth.py
> +++ b/fas/auth.py
> @@ -89,7 +89,7 @@ def CLADone(person):
> '''
> Returns True if the user has completed the CLA
> '''
> - cla_done_group =config.get('cla_done_group')
> + cla_done_group = config.get('cla_done_group')
> try:
> if person.group_roles[cla_done_group].role_status == 'approved':
> return True
> diff --git a/fas/json_request.py b/fas/json_request.py
> index d762ed4..e56bfc3 100644
> --- a/fas/json_request.py
> +++ b/fas/json_request.py
> @@ -27,6 +27,7 @@ import sqlalchemy
>
> from fas.model import People
> from fas.model import Groups
> +from fas.model import PersonRoles
>
> class JsonRequest(controllers.Controller):
> def __init__(self):
> @@ -57,6 +58,19 @@ class JsonRequest(controllers.Controller):
>
> @identity.require(turbogears.identity.not_anonymous())
> @expose("json", allow_json=True)
> + def fas_client(self):
> + output = [];
> + try:
> + roles = PersonRoles.query.all()
> + for role in roles:
> + role.member.filter_private()
> + output.append((role.member, role.role_type, role.group.name))
> + return dict(success=True, output=output)
> + except InvalidRequestError:
> + return dict(success=False)
> +
> + @identity.require(turbogears.identity.not_anonymous())
> + @expose("json", allow_json=True)
> def person_by_username(self, username):
> try:
> person = People.by_username(username)
>
>
>