ensure ccpo review fields are optional, add form error alert to review screen
This commit is contained in:
parent
ac51931d89
commit
041cfe878f
@ -1,6 +1,6 @@
|
|||||||
from wtforms.fields.html5 import EmailField, TelField
|
from wtforms.fields.html5 import EmailField, TelField
|
||||||
from wtforms.fields import StringField, TextAreaField
|
from wtforms.fields import StringField, TextAreaField
|
||||||
from wtforms.validators import Email
|
from wtforms.validators import Email, Optional
|
||||||
|
|
||||||
from .forms import ValidatedForm
|
from .forms import ValidatedForm
|
||||||
from .validators import Alphabet, PhoneNumber
|
from .validators import Alphabet, PhoneNumber
|
||||||
@ -8,11 +8,19 @@ from .validators import Alphabet, PhoneNumber
|
|||||||
|
|
||||||
class CCPOReviewForm(ValidatedForm):
|
class CCPOReviewForm(ValidatedForm):
|
||||||
comment = TextAreaField("Comments (optional)")
|
comment = TextAreaField("Comments (optional)")
|
||||||
fname_mao = StringField("First Name (optional)", validators=[Alphabet()])
|
fname_mao = StringField(
|
||||||
lname_mao = StringField("Last Name (optional)", validators=[Alphabet()])
|
"First Name (optional)", validators=[Optional(), Alphabet()]
|
||||||
email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()])
|
)
|
||||||
phone_mao = TelField(
|
lname_mao = StringField("Last Name (optional)", validators=[Optional(), Alphabet()])
|
||||||
"Mission Owner phone number (optional)", validators=[PhoneNumber()]
|
email_mao = EmailField(
|
||||||
|
"Mission Owner e-mail (optional)", validators=[Optional(), Email()]
|
||||||
|
)
|
||||||
|
phone_mao = TelField(
|
||||||
|
"Mission Owner phone number (optional)", validators=[Optional(), PhoneNumber()]
|
||||||
|
)
|
||||||
|
fname_ccpo = StringField(
|
||||||
|
"First Name (optional)", validators=[Optional(), Alphabet()]
|
||||||
|
)
|
||||||
|
lname_ccpo = StringField(
|
||||||
|
"Last Name (optional)", validators=[Optional(), Alphabet()]
|
||||||
)
|
)
|
||||||
fname_ccpo = StringField("First Name (optional)", validators=[Alphabet()])
|
|
||||||
lname_ccpo = StringField("Last Name (optional)", validators=[Alphabet()])
|
|
||||||
|
@ -8,6 +8,13 @@
|
|||||||
|
|
||||||
<article class='col col--grow request-approval'>
|
<article class='col col--grow request-approval'>
|
||||||
|
|
||||||
|
{% if f.errors %}
|
||||||
|
{{ Alert('There were some errors',
|
||||||
|
message="<p>Please see below.</p>",
|
||||||
|
level='error'
|
||||||
|
) }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<form method="POST" action="{{ url_for("requests.submit_approval", request_id=request_id) }}" autocomplete="off">
|
<form method="POST" action="{{ url_for("requests.submit_approval", request_id=request_id) }}" autocomplete="off">
|
||||||
{{ f.csrf_token }}
|
{{ f.csrf_token }}
|
||||||
<section class='panel'>
|
<section class='panel'>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user