This repository has been archived on 2025-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Alicja Cięciwa 3ffce6c7c3 registration fixes
2020-11-15 13:32:50 +01:00

50 lines
1.3 KiB
Python

from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
# class RegisterForm(UserCreationForm):
#
# class Meta:
# model = User
# fields = ['username', 'password1', 'password2']
#
# def __init__(self, *args, **kwargs):
# super(RegisterForm, self).__init__(*args, **kwargs)
# self.fields['username'] = forms.CharField(
# widget=forms.TextInput(attrs={
# 'placeholder': 'Nazwa użytkownika'
# }),
# error_messages={
# 'required': 'Wpisz nazwę użytkownika',
# })
# self.fields['password1'] = forms.CharField(
# widget=forms.PasswordInput(attrs={
# 'placeholder': 'Hasło'
# }),
# error_messages={
# 'required': 'Podaj hasło',
# })
# self.fields['password2'] = forms.CharField(
# widget=forms.PasswordInput(attrs={
# 'placeholder': 'Powtórz hasło'
# }),
# error_messages={
# 'required': 'Podaj hasło',
# })
#
# for field in ['username', 'password1', 'password2']:
# self.fields[field].help_text = None
# self.fields[field].label = ''
#