mirror of
				https://github.com/StefBuwalda/WebTech.git
				synced 2025-10-30 19:29:58 +00:00 
			
		
		
		
	Cleanup gang
This commit is contained in:
		| @@ -3,16 +3,21 @@ from wtforms import StringField, SubmitField, PasswordField, BooleanField | ||||
| from wtforms.validators import DataRequired | ||||
|  | ||||
|  | ||||
| # Default Form that inherits from FlaskForm and | ||||
| # contains a username, password and submit button | ||||
| class defaultForm(FlaskForm): | ||||
|     username = StringField("Username", validators=[DataRequired()]) | ||||
|     password = PasswordField("Password", validators=[DataRequired()]) | ||||
|     submit = SubmitField("Submit") | ||||
|  | ||||
|  | ||||
| # LoginForm, contains exactly the same as defaultForm | ||||
| class LoginForm(defaultForm): | ||||
|     pass | ||||
|  | ||||
|  | ||||
| # RegisterForm that inherits from the default. | ||||
| # Adds a password confirmation and if the user is an admin or not. | ||||
| class RegisterForm(defaultForm): | ||||
|     confirm_password = PasswordField( | ||||
|         "Confirm Password", validators=[DataRequired()] | ||||
| @@ -20,6 +25,8 @@ class RegisterForm(defaultForm): | ||||
|     is_admin = BooleanField("Admin") | ||||
|  | ||||
|  | ||||
| # Form to update password information. | ||||
| # Needs a confirmation password and the current password | ||||
| class UpdateForm(defaultForm): | ||||
|     confirm_password = PasswordField( | ||||
|         "Confirm Password", validators=[DataRequired()] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user