Exemplo n.º 1
0
Arquivo: views.py Projeto: GovLab/noi2
def has_user_done_register_step_2(user):
    '''
    Returns whether or not, to the best of our knowledge, the user
    has completed step 2 (or a later step) of registration yet.
    '''

    return len(user.skills) > 0 or RegisterStep2Form.is_not_empty(user)
Exemplo n.º 2
0
def get_best_registration_step_url(user):
    '''
    Assuming the user is not yet fully registered, returns the URL
    of the most appropriate step in the registration flow for
    them to complete.
    '''

    if len(user.skills) > 0 or RegisterStep2Form.is_not_empty(user):
        return url_for('views.register_step_3')
    return url_for('views.register_step_2')
Exemplo n.º 3
0
Arquivo: views.py Projeto: tekd/noi2
def get_best_registration_step_url(user):
    '''
    Assuming the user is not yet fully registered, returns the URL
    of the most appropriate step in the registration flow for
    them to complete.
    '''

    if len(user.skills) > 0 or RegisterStep2Form.is_not_empty(user):
        return url_for('views.register_step_3')
    return url_for('views.register_step_2')