def index(self): '''Display the FPCAs (and accept/do not accept buttons)''' show = {} show['show_postal_address'] = config.get('show_postal_address') username = turbogears.identity.current.user_name person = People.by_username(username) try: code_len = len(person.country_code) except TypeError: code_len = 0 if show['show_postal_address']: contactInfo = person.telephone or person.postal_address if person.country_code == 'O1' and not person.telephone: turbogears.flash(_('A telephone number is required to ' + \ 'complete the FPCA. Please fill out below.')) elif not person.country_code or not person.human_name \ or not contactInfo: turbogears.flash(_('A valid country and telephone number ' + \ 'or postal address is required to complete the FPCA. ' + \ 'Please fill them out below.')) else: if not person.telephone or code_len != 2 or \ person.country_code == ' ': turbogears.flash(_('A valid country and telephone number are' + ' required to complete the FPCA. Please fill them ' + 'out below.')) (cla, undeprecated_cla) = undeprecated_cla_done(person) person = person.filter_private() return dict(cla=undeprecated_cla, person=person, date=datetime.utcnow().ctime(), show=show)
def home(self): user_name = turbogears.identity.current.user_name person = People.by_username(user_name) (cla_done, undeprecated_cla) = undeprecated_cla_done(person) person = person.filter_private() return dict(person=person, memberships=person['memberships'], cla=undeprecated_cla)
def index(self): """Display the FPCAs (and accept/do not accept buttons)""" show = {} show["show_postal_address"] = config.get("show_postal_address") username = turbogears.identity.current.user_name person = People.by_username(username) try: code_len = len(person.country_code) except TypeError: code_len = 0 if show["show_postal_address"]: contactInfo = person.telephone or person.postal_address if person.country_code == "O1" and not person.telephone: turbogears.flash(_("A telephone number is required to " + "complete the FPCA. Please fill out below.")) elif not person.country_code or not person.human_name or not contactInfo: turbogears.flash( _( "A valid country and telephone number " + "or postal address is required to complete the FPCA. " + "Please fill them out below." ) ) else: if not person.telephone or code_len != 2 or person.country_code == " ": turbogears.flash( _( "A valid country and telephone number are" + " required to complete the FPCA. Please fill them " + "out below." ) ) (cla, undeprecated_cla) = undeprecated_cla_done(person) person = person.filter_private() return dict(cla=undeprecated_cla, person=person, date=datetime.utcnow().ctime(), show=show)