add thanks url; need to fill in template

pull/1/head
nathaniel smith 2016-11-30 00:29:39 -08:00
parent 2d8abd3577
commit 66622831d5
1 changed files with 3 additions and 6 deletions

View File

@ -6,7 +6,6 @@ from django.http import HttpResponse
from django.shortcuts import redirect from django.shortcuts import redirect
from django.views.generic import TemplateView from django.views.generic import TemplateView
from django.views.generic.edit import FormView from django.views.generic.edit import FormView
from django.urls import reverse
from .forms import TownieForm from .forms import TownieForm
from .models import Townie from .models import Townie
@ -14,11 +13,10 @@ from .models import Townie
class SignupView(FormView): class SignupView(FormView):
form_class = TownieForm form_class = TownieForm
template_name = 'users/signup.html' template_name = 'users/signup.html'
# TODO reverse
success_url = '/thanks'
def form_valid(self, form): def form_valid(self, form):
# TODO
#t = Townie( #t = Townie(
# username=username, # username=username,
# displayname=displayname, # displayname=displayname,
@ -28,10 +26,9 @@ class SignupView(FormView):
#t.set_unusable_password() #t.set_unusable_password()
#t.save() #t.save()
return redirect('users:thanks')
return super().form_valid(form)
# TODO add template for this once i've fixed template directories # TODO actually fill in this template
class ThanksView(TemplateView): class ThanksView(TemplateView):
template_name = 'users/thanks.html' template_name = 'users/thanks.html'