예제 #1
0
파일: fpca.py 프로젝트: ccoss/fas
    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)
예제 #2
0
파일: controllers.py 프로젝트: 0-T-0/fas
    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)
예제 #3
0
파일: fpca.py 프로젝트: fedora-infra/fas
    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)
예제 #4
0
    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)
예제 #5
0
    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)