summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2008-07-22 00:20:14 (GMT)
committerToshio Kuratomi <toshio@fedoraproject.org>2008-07-22 00:20:14 (GMT)
commit74b8337bb013c79ebc58dffd84ac1db8245404b1 (patch)
treeb5f6e007486e112493d8cbe8e1e54c980b902085
parentedfcfe7ed9ebaed30370c8a2c03ab519621aa462 (diff)
downloadfas-74b8337bb013c79ebc58dffd84ac1db8245404b1.zip
fas-74b8337bb013c79ebc58dffd84ac1db8245404b1.tar.gz
fas-74b8337bb013c79ebc58dffd84ac1db8245404b1.tar.xz
Filter people for privacy data.
-rw-r--r--fas/group.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/fas/group.py b/fas/group.py
index 357e0a0..eb8a75d 100644
--- a/fas/group.py
+++ b/fas/group.py
@@ -614,10 +614,12 @@ into the e-mail aliases within an hour.
sponsorship = dict(pair for pair in sponsorCount.execute())
# We filter this so that sending information via json is quick(er)
- filteredPeople = sorted((p[0].username, p[0].email, p[0].human_name,
- p[1], sponsorship.get(p[0].username, 0)) for p in people)
+ filterPrivacy = (p[0].filter_private(), p[1]) for p in people)
+ filteredPeople = ((p[0].username, p[0].email, p[0].human_name, p[1],
+ sponsorship.get(p[0].username, 0)) for p in filterPrivacy)
+ sortedPeople = sorted(filteredPeople)
- return dict(people=filteredPeople)
+ return dict(people=sortedPeople)
@identity.require(identity.not_anonymous())
@validate(validators=GroupInvite())
@@ -628,6 +630,7 @@ into the e-mail aliases within an hour.
person = People.by_username(username)
group = Groups.by_name(groupname)
+ person = person.filter_private()
return dict(person=person, group=group)
@identity.require(identity.not_anonymous())
@@ -662,5 +665,6 @@ Fedora and FOSS are changing the world -- come be a part of it!''') % {'name': p
turbogears.redirect('/group/view/%s' % group.name)
else:
turbogears.flash(_("You are not in the '%s' group.") % group.name)
- return dict(target=target, person=person, group=group)
+ person = person.filter_private()
+ return dict(target=target, person=person, group=group)