refine required fields for request review

This commit is contained in:
dandds 2018-09-10 10:42:04 -04:00
parent c4e9971206
commit bad78b7c64
4 changed files with 63 additions and 13 deletions

View File

@ -0,0 +1,50 @@
"""request_reviews non-nullable fields
Revision ID: bc6edccded26
Revises: 7bdb2055d7c7
Create Date: 2018-09-10 10:38:00.107297
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'bc6edccded26'
down_revision = '7bdb2055d7c7'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('request_reviews', 'fname_ccpo',
existing_type=sa.VARCHAR(),
nullable=False)
op.alter_column('request_reviews', 'fname_mao',
existing_type=sa.VARCHAR(),
nullable=False)
op.alter_column('request_reviews', 'lname_ccpo',
existing_type=sa.VARCHAR(),
nullable=False)
op.alter_column('request_reviews', 'lname_mao',
existing_type=sa.VARCHAR(),
nullable=False)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column('request_reviews', 'lname_mao',
existing_type=sa.VARCHAR(),
nullable=True)
op.alter_column('request_reviews', 'lname_ccpo',
existing_type=sa.VARCHAR(),
nullable=True)
op.alter_column('request_reviews', 'fname_mao',
existing_type=sa.VARCHAR(),
nullable=True)
op.alter_column('request_reviews', 'fname_ccpo',
existing_type=sa.VARCHAR(),
nullable=True)
# ### end Alembic commands ###

View File

@ -8,15 +8,14 @@ from .validators import Alphabet, PhoneNumber
class CCPOReviewForm(ValidatedForm): class CCPOReviewForm(ValidatedForm):
comments = TextAreaField( comments = TextAreaField(
"Comments", "Comments (optional)",
description="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.",
) )
fname_mao = StringField("First Name", validators=[Required(), Alphabet()]) fname_mao = StringField("First Name", validators=[Required(), Alphabet()])
lname_mao = StringField("Last Name", validators=[Required(), Alphabet()]) lname_mao = StringField("Last Name", validators=[Required(), Alphabet()])
email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()]) email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()])
phone_mao = TelField( phone_mao = TelField(
"Mission Owner phone number (optional)", "Mission Owner phone number (optional)",
validators=[Required(), PhoneNumber()], validators=[PhoneNumber()],
) )
fname_ccpo = StringField("First Name", validators=[Required(), Alphabet()]) fname_ccpo = StringField("First Name", validators=[Required(), Alphabet()])
lname_ccpo = StringField("Last Name", validators=[Required(), Alphabet()]) lname_ccpo = StringField("Last Name", validators=[Required(), Alphabet()])

View File

@ -11,9 +11,9 @@ class RequestReview(Base):
status = relationship("RequestStatusEvent", back_populates="review") status = relationship("RequestStatusEvent", back_populates="review")
comments = Column(String) comments = Column(String)
fname_mao = Column(String) fname_mao = Column(String, nullable=False)
lname_mao = Column(String) lname_mao = Column(String, nullable=False)
email_mao = Column(String) email_mao = Column(String)
phone_mao = Column(String) phone_mao = Column(String)
fname_ccpo = Column(String) fname_ccpo = Column(String, nullable=False)
lname_ccpo = Column(String) lname_ccpo = Column(String, nullable=False)

View File

@ -39,11 +39,7 @@
Provide instructions or notes for additional information that is necessary to approve the request here. The requestor may then re-submit the updated request or initiate contact outside of AT-AT if further discussion is required. <b>These notes will be visible to the person making the JEDI request</b>. Provide instructions or notes for additional information that is necessary to approve the request here. The requestor may then re-submit the updated request or initiate contact outside of AT-AT if further discussion is required. <b>These notes will be visible to the person making the JEDI request</b>.
<div class='usa-input'> {{ TextInput(f.comments, paragraph=True, placeholder="Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.") }}
<label for='notes'>Comments <em>(optional)</em></label>
<textarea id='notes' placeholder='Add notes or comments explaining what changes are being requested or why further discussion is needed about this request.'/></textarea>
</div>
</div> </div>
@ -106,7 +102,12 @@
<div class='form-row'> <div class='form-row'>
<div class='form-col'> <div class='form-col'>
{{ TextInput(f.comments, paragraph=True, placeholder="Add notes or comments for internal CCPO reference.") }}
<div class='usa-input'>
<label for='notes'>Internal Comments <em>(optional)</em></label>
<textarea id='notes' placeholder='Add notes or comments for internal CCPO reference.'/></textarea>
</div>
</div> </div>
</div> </div>