class AddNewReview(LoginRequiredMixin, CreateView):
model = Review
form_class = AddReview
template_name = 'books/add_review.html'
success_url = reverse_lazy('book_list')
def form_valid(self, form):
form.instance.author = self.request.user
return super().form_valid(form)