Error while running migrated project from django 1.7 to django 1.10

0

I'm migrating a project made in django 1.7 to django 1.10, when I try to run the project I get the error:

  

The view core.config.views.home did not return an HttpResponse object.   It returned None instead.

So I could understand this and because of the reverse that was discontinued, the view that the error refers to is the following:

@login_required
def home(request):
    dados={}
    if request.user.has_perm('admin'):
        return render(request, 'Template_Error.html',{'mensagem':"Você não possui permissão para Logar no sistema",'titulo':'Aviso!'})
    if request.user.has_perm('ava.view_professor'):
        return redirect(reverse(viewname='home_professor'))
    elif request.user.has_perm('ava.view_aluno'):
        return redirect(reverse(viewname='home_aluno'))

What is the correct way to do this today?

    
asked by anonymous 03.01.2017 / 23:34

1 answer

0

In documentation explains that just passing the view name to redirect that reverse will be used.

def my_view(request):
...
return redirect('some-view-name', foo='bar')
    
04.01.2017 / 14:00