Пример #1
0
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)
Пример #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')
Пример #3
0
Файл: views.py Проект: 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')