mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 14:28:09 +00:00
user registration pages
This commit is contained in:
42
core/views/user_registration.py
Normal file
42
core/views/user_registration.py
Normal file
@@ -0,0 +1,42 @@
|
||||
from django import forms
|
||||
from django.http import HttpResponseRedirect
|
||||
from django.shortcuts import render
|
||||
|
||||
"""
|
||||
This is the new individual user login registration, instead of everyone signing
|
||||
in as "expo". This will be useful for the kanban expo organisation tool.
|
||||
"""
|
||||
|
||||
|
||||
def register(request):
|
||||
if request.method == "POST":
|
||||
form = register_form(request.POST)
|
||||
if form.is_valid():
|
||||
# <process form cleaned data>
|
||||
return HttpResponseRedirect("/success/")
|
||||
else:
|
||||
form = register_form(initial={"visible": "True"})
|
||||
|
||||
return render(request, "login/register.html", {"form": form})
|
||||
|
||||
class register_form(forms.Form): # not a model-form, just a form-form
|
||||
username = forms.CharField(strip=True, required=True,
|
||||
label="Username",
|
||||
widget=forms.TextInput(
|
||||
attrs={"size": 35, "placeholder": "e.g. anathema-device",
|
||||
"style": "vertical-align: text-top;"}
|
||||
))
|
||||
password1 = forms.CharField(strip=True, required=True,
|
||||
label="Password",
|
||||
widget=forms.TextInput(
|
||||
attrs={"size": 30, "placeholder": "your new login password",
|
||||
"style": "vertical-align: text-top;"}
|
||||
))
|
||||
password2 = forms.CharField(strip=True, required=True,
|
||||
label="Re-type your password",
|
||||
widget=forms.TextInput(
|
||||
attrs={"size": 30, "placeholder": "same as the password above",
|
||||
"style": "vertical-align: text-top;"}
|
||||
) )
|
||||
|
||||
# )
|
||||
Reference in New Issue
Block a user