Example #1
0
def add_level(request):
    """ Add level (hierachy slug) of logged-in provider or None """
    try:
        level = get_level_for(request.user.get_profile())
    except:
        level = None
    return {'level': level}
Example #2
0
def index(request):
    provider = request.user.get_profile()

    level = get_level_for(provider)

    # forward user to his matching level
    if level == 'national':
        return index_national(request)

    if level == 'region':
        return index_region(request)

    if level == 'district':
        return index_district(request)

    return index_norole(request)
Example #3
0
def index(request):
    provider = request.user.get_profile()

    level = get_level_for(provider)

    # forward user to his matching level
    if level == "national":
        return index_national(request)

    if level == "region":
        return index_region(request)

    if level == "district":
        return index_district(request)

    return index_norole(request)