summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2008-07-22 00:06:27 (GMT)
committerToshio Kuratomi <toshio@fedoraproject.org>2008-07-22 00:06:27 (GMT)
commitedfcfe7ed9ebaed30370c8a2c03ab519621aa462 (patch)
treefcdb62faaab8413eda27140769e61ec7692832be
parentf50270e1385622e2eca5bcd7d23f8b451726b223 (diff)
downloadfas-edfcfe7ed9ebaed30370c8a2c03ab519621aa462.zip
fas-edfcfe7ed9ebaed30370c8a2c03ab519621aa462.tar.gz
fas-edfcfe7ed9ebaed30370c8a2c03ab519621aa462.tar.xz
Add filter_private() when returning people data from these methods.
-rw-r--r--fas/cla.py12
-rw-r--r--fas/controllers.py1
2 files changed, 10 insertions, 3 deletions
diff --git a/fas/cla.py b/fas/cla.py
index 11771a2..83a64aa 100644
--- a/fas/cla.py
+++ b/fas/cla.py
@@ -63,9 +63,13 @@ class CLA(controllers.Controller):
code_len = len(person.country_code)
except TypeError:
code_len = 0
- if not person.telephone or not person.postal_address or code_len != 2 or person.country_code==' ':
- turbogears.flash('A valid postal Address, country and telephone number are required to complete the CLA. Please fill them out below.')
+ if not person.telephone or not person.postal_address or code_len != 2 \
+ or person.country_code==' ':
+ turbogears.flash('A valid postal Address, country and telephone'
+ ' number are required to complete the CLA. Please fill'
+ ' them out below.')
cla = CLADone(person)
+ person = person.filter_private()
return dict(cla=cla, person=person, date=datetime.utcnow().ctime())
def _cla_dependent(self, group):
@@ -104,6 +108,7 @@ class CLA(controllers.Controller):
'''View CLA as text'''
username = turbogears.identity.current.user_name
person = People.by_username(username)
+ person = person.filter_private()
return dict(person=person, date=datetime.utcnow().ctime())
### FIXME: error_handler() does nothing without a validator
@@ -116,6 +121,7 @@ class CLA(controllers.Controller):
'''Download CLA'''
username = turbogears.identity.current.user_name
person = People.by_username(username)
+ person = person.filter_private()
return dict(person=person, date=datetime.utcnow().ctime())
### FIXME: error_handler() does nothing without a validator
@@ -230,7 +236,7 @@ Thanks!
turbogears.flash(_("Your updated information could not be saved."))
turbogears.redirect('/cla/')
return dict()
-
+
# Heuristics to detect bad data
if not person.telephone or \
not person.postal_address or \
diff --git a/fas/controllers.py b/fas/controllers.py
index 3553d23..5d9c298 100644
--- a/fas/controllers.py
+++ b/fas/controllers.py
@@ -156,6 +156,7 @@ class Root(plugin.RootController):
user_name = turbogears.identity.current.user_name
person = People.by_username(user_name)
cla = CLADone(person)
+ person = person.filter_private()
return dict(person=person, cla=cla)
@expose(template="fas.templates.about")