added hr accounts only to register form

This commit is contained in:
crunk 2022-03-27 18:20:47 +02:00
parent b193582c8a
commit b3f7e1fb6f
2 changed files with 19 additions and 7 deletions

View File

@ -6,12 +6,17 @@ from wtforms import (
)
from wtforms import validators
from wtforms.validators import Length, Email, EqualTo
from wtforms.validators import Length, Email, EqualTo, ValidationError
from flask_wtf import FlaskForm
class RegisterForm(FlaskForm):
"""Register for distribusi-verse form class"""
def hremail(form, field):
if not field.data.endswith("@hr.nl"):
raise ValidationError("Only HRO accounts are allowed.")
username = StringField(
"Username:",
validators=[validators.InputRequired(), Length(3, 150)],
@ -19,12 +24,19 @@ class RegisterForm(FlaskForm):
email = StringField(
"Email address:",
validators=[validators.InputRequired(), Email(), Length(6, 64)],
validators=[
validators.InputRequired(),
Email(),
Length(6, 64),
hremail,
]
)
password = PasswordField(
"New password:",
validators=[validators.InputRequired(), Length(12, 72)],
)
confirmpassword = PasswordField(
"Confirm your password:",
validators=[

View File

@ -70,7 +70,7 @@ the following html in your distribusi page:</p>
&lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id that is the same as the
<em>file name.</em> The <strong>img</strong> tag gets a class attribute <em>image</em>
This is handy for styling your files with css (See 5.)</p>
This is handy for styling your files with CSS (See 5.)</p>
<hr>
<h3>3. Folders become links and pages</h3>
<p>When you make your zipfile, this zipfile can contain folders with more
@ -83,7 +83,7 @@ same style. </p>
&lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id
<em>folder.</em> and a class attribute <em>dir</em>
This is handy for styling your files with css (See 5.)</p>
This is handy for styling your files with CSS (See 5.)</p>
<p>the anchor <em>(a)</em> tag will get an href attribute pointing to the
subfolder</p>
<hr>
@ -100,16 +100,16 @@ add simple text elements to their pages.</p>
&lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id that is the same as the
<em>file name.</em> and a class attribute <em>plain</em>
This is handy for styling your files with css (See 5.)</p>
This is handy for styling your files with CSS (See 5.)</p>
<hr>
<h3>5. Use Css to style your page</h3>
<h3>5. Use CSS to style your page</h3>
<p>Distribusi offers almost full support for styling your page with CSS.
Because all content is auto generated your CSS will be placed in a
style tag in the head of each HTML file.</p>
<p>Distrbusi-verse allows its users to skip this step by just selecting a basic
theme or by selecting one of the themes other users have made <em>public.</em>
<p>Alternatively a user can opt to make their own custom theme, either in a
simple online editor or by uploading their own Css file.</p>
simple online editor or by uploading their own CSS file.</p>
<hr>
</div>
{% endblock %}