2👍
✅
You’ve using save with commit=False
so you’re almost there. You can get the logged in user from the request object.
if form.is_valid():
review = form.save(commit=False)
review.product = p
review.user = request. user
review.save()
For more details, see the Django docs for user authentication.
Source:stackexchange.com