Merge pull request #8 from pyohio/sponsorship-redirect
Dynamic redirect after applying to be a sponsor.
This commit is contained in:
commit
3711ddf24e
1 changed files with 10 additions and 1 deletions
|
@ -15,7 +15,16 @@ def sponsor_apply(request):
|
||||||
form = SponsorApplicationForm(request.POST, user=request.user)
|
form = SponsorApplicationForm(request.POST, user=request.user)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
sponsor = form.save()
|
sponsor = form.save()
|
||||||
|
if sponsor.sponsor_benefits.all():
|
||||||
|
# Redirect user to sponsor_detail to give extra information.
|
||||||
|
messages.success(request, "Thank you for your sponsorship "
|
||||||
|
"application. Please update your "
|
||||||
|
"benefit details below.")
|
||||||
return redirect("sponsor_detail", pk=sponsor.pk)
|
return redirect("sponsor_detail", pk=sponsor.pk)
|
||||||
|
else:
|
||||||
|
messages.success(request, "Thank you for your sponsorship "
|
||||||
|
"application.")
|
||||||
|
return redirect("dashboard")
|
||||||
else:
|
else:
|
||||||
form = SponsorApplicationForm(user=request.user)
|
form = SponsorApplicationForm(user=request.user)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue