Ejemplo n.º 1
0
def assistant_home(request):
    if (settings.access_to_procedure_is_open() or settings.assistants_can_see_file()) \
            and academic_assistant.find_by_person(person=request.user.person):
        return HttpResponseRedirect(reverse('assistant_mandates'))
    else:
        try:
            manager.find_by_person(person=request.user.person)
            return HttpResponseRedirect(reverse('manager_home'))
        except manager.Manager.DoesNotExist:
            if reviewer.find_by_person(person=request.user.person):
                return HttpResponseRedirect(reverse('reviewer_mandates_list_todo'))
            else:
                return HttpResponseRedirect(reverse('access_denied'))
Ejemplo n.º 2
0
def assistant_home(request):
    if settings.access_to_procedure_is_open(
    ) and academic_assistant.find_by_person(person=request.user.person):
        return HttpResponseRedirect(reverse('assistant_mandates'))
    else:
        try:
            manager.find_by_person(person=request.user.person)
            return HttpResponseRedirect(reverse('manager_home'))
        except manager.Manager.DoesNotExist:
            if reviewer.find_by_person(person=request.user.person):
                return HttpResponseRedirect(
                    reverse('reviewer_mandates_list_todo'))
            else:
                return HttpResponseRedirect(reverse('access_denied'))
Ejemplo n.º 3
0
def user_is_manager(user):

    try:
        if user.is_authenticated():
            return manager.find_by_person(person=user.person)
    except ObjectDoesNotExist:
        return False
Ejemplo n.º 4
0
def user_is_manager(user):

    try:
        if user.is_authenticated:
            return manager.find_by_person(person=user.person)
    except ObjectDoesNotExist:
        return False