コード例 #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}
コード例 #2
0
ファイル: dashboard.py プロジェクト: yeleman/pnlp_web
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)
コード例 #3
0
ファイル: dashboard.py プロジェクト: yeleman/pnlp_web
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)