add thanks url; need to fill in template
parent
2d8abd3577
commit
66622831d5
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue