redirect to sponsor edit after submission; allow sponsor details to be filled out before approval

This commit is contained in:
James Tauber 2012-10-18 13:24:08 -04:00
parent 6bb23205de
commit daff4020ea

View file

@ -14,8 +14,8 @@ def sponsor_apply(request):
if request.method == "POST":
form = SponsorApplicationForm(request.POST, user=request.user)
if form.is_valid():
form.save()
return redirect("dashboard")
sponsor = form.save()
return redirect("sponsor_detail", pk=sponsor.pk)
else:
form = SponsorApplicationForm(user=request.user)
@ -48,7 +48,7 @@ def sponsor_add(request):
def sponsor_detail(request, pk):
sponsor = get_object_or_404(Sponsor, pk=pk)
if not sponsor.active or sponsor.applicant != request.user:
if sponsor.applicant != request.user:
return redirect("sponsor_list")
formset_kwargs = {