2016-11-30 07:48:02 +00:00
|
|
|
import re
|
|
|
|
|
|
|
|
from django.core.exceptions import ValidationError
|
|
|
|
from django.forms import Form, CharField, EmailField, Textarea, ChoiceField, BooleanField
|
2016-11-20 05:34:38 +00:00
|
|
|
from django.http import HttpResponse
|
2016-11-30 07:48:02 +00:00
|
|
|
from django.shortcuts import redirect
|
2016-11-20 05:34:38 +00:00
|
|
|
from django.views.generic import TemplateView
|
2016-11-30 07:48:02 +00:00
|
|
|
from django.views.generic.edit import FormView
|
2016-11-20 05:34:38 +00:00
|
|
|
|
2016-11-30 07:48:02 +00:00
|
|
|
from .forms import TownieForm
|
|
|
|
from .models import Townie
|
2016-11-21 07:56:55 +00:00
|
|
|
|
2016-11-30 07:48:02 +00:00
|
|
|
class SignupView(FormView):
|
|
|
|
form_class = TownieForm
|
|
|
|
template_name = 'users/signup.html'
|
2016-11-21 07:56:55 +00:00
|
|
|
|
2016-11-30 07:48:02 +00:00
|
|
|
def form_valid(self, form):
|
2016-11-21 07:56:55 +00:00
|
|
|
|
2016-11-30 08:29:39 +00:00
|
|
|
# TODO
|
2016-11-30 07:48:02 +00:00
|
|
|
#t = Townie(
|
|
|
|
# username=username,
|
|
|
|
# displayname=displayname,
|
|
|
|
# pubkey=pubkey,
|
|
|
|
# email=email,
|
|
|
|
#)
|
2016-11-21 07:56:55 +00:00
|
|
|
|
2016-11-30 07:48:02 +00:00
|
|
|
#t.set_unusable_password()
|
|
|
|
#t.save()
|
2016-11-30 08:29:39 +00:00
|
|
|
return redirect('users:thanks')
|
2016-11-21 07:56:55 +00:00
|
|
|
|
|
|
|
|
2016-11-30 08:29:39 +00:00
|
|
|
# TODO actually fill in this template
|
2016-11-30 07:48:02 +00:00
|
|
|
class ThanksView(TemplateView):
|
|
|
|
template_name = 'users/thanks.html'
|