tôi bắt mắc phải một lỗi như sau : The view iot.views.post_new didn't return an HttpResponse object. It returned None instead : tôi bắt mắc phải một lỗi như sau : The view iot.views.post_new didn't return an HttpResponse object. It returned None instead.
Hope everybody help please.

This is my views.py file:

    def post_new(request):
        if request.method == "POST":
            form = PostForm(request.POST or None)
            if form.is_valid():
                ct = form.save(commit=False)
                ct.author = request.user
                ct.upload_time = request.upload_time
                ct.save()
                return redirect('iot:detail', pk=ct.pk)
        else:
            form = PostForm()
            return render(request, 'iot/post.html', {"form":form})