Browse Source

added hr accounts only to register form

current_wdka_release
crunk 3 years ago
parent
commit
b3f7e1fb6f
  1. 16
      verse/forms/registerform.py
  2. 10
      verse/templates/help.html

16
verse/forms/registerform.py

@ -6,12 +6,17 @@ from wtforms import (
) )
from wtforms import validators from wtforms import validators
from wtforms.validators import Length, Email, EqualTo from wtforms.validators import Length, Email, EqualTo, ValidationError
from flask_wtf import FlaskForm from flask_wtf import FlaskForm
class RegisterForm(FlaskForm): class RegisterForm(FlaskForm):
"""Register for distribusi-verse form class""" """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 = StringField(
"Username:", "Username:",
validators=[validators.InputRequired(), Length(3, 150)], validators=[validators.InputRequired(), Length(3, 150)],
@ -19,12 +24,19 @@ class RegisterForm(FlaskForm):
email = StringField( email = StringField(
"Email address:", "Email address:",
validators=[validators.InputRequired(), Email(), Length(6, 64)], validators=[
validators.InputRequired(),
Email(),
Length(6, 64),
hremail,
]
) )
password = PasswordField( password = PasswordField(
"New password:", "New password:",
validators=[validators.InputRequired(), Length(12, 72)], validators=[validators.InputRequired(), Length(12, 72)],
) )
confirmpassword = PasswordField( confirmpassword = PasswordField(
"Confirm your password:", "Confirm your password:",
validators=[ validators=[

10
verse/templates/help.html

@ -70,7 +70,7 @@ the following html in your distribusi page:</p>
&lt;/div&gt;</pre> &lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id that is the same as the <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> <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> <hr>
<h3>3. Folders become links and pages</h3> <h3>3. Folders become links and pages</h3>
<p>When you make your zipfile, this zipfile can contain folders with more <p>When you make your zipfile, this zipfile can contain folders with more
@ -83,7 +83,7 @@ same style. </p>
&lt;/div&gt;</pre> &lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id <p>The encapsulating <strong>div</strong> tag gets an id
<em>folder.</em> and a class attribute <em>dir</em> <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 <p>the anchor <em>(a)</em> tag will get an href attribute pointing to the
subfolder</p> subfolder</p>
<hr> <hr>
@ -100,16 +100,16 @@ add simple text elements to their pages.</p>
&lt;/div&gt;</pre> &lt;/div&gt;</pre>
<p>The encapsulating <strong>div</strong> tag gets an id that is the same as the <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> <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> <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. <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 Because all content is auto generated your CSS will be placed in a
style tag in the head of each HTML file.</p> 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 <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> 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 <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> <hr>
</div> </div>
{% endblock %} {% endblock %}

Loading…
Cancel
Save