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'))
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'))
def user_is_manager(user): try: if user.is_authenticated(): return manager.find_by_person(person=user.person) except ObjectDoesNotExist: return False
def user_is_manager(user): try: if user.is_authenticated: return manager.find_by_person(person=user.person) except ObjectDoesNotExist: return False