I am passing a variable from template to view with form POST method. And view uses @login_required decorator as it is needed. If user is not logged in it goes login page and come backs to the view again but the passed variable information was not there anymore. Is there any way to solve this? I found a old stackoverflow post here but it's not working for me. Below is my view function
@login_required
def become_booster(request):
if request.method == "POST"
email = request.POST.get('email')
user = CustomUser.objects.get(email= email)
tiers = Tiers.objects.filter(user=user)
form = SubscriptionForm
return render(request,'select_tier.html',{'tiers':tiers,'form':form,'creator':user})
Instead of form POST, I am sending user info with url and my issue was resolved.