all request review fields are nullable

This commit is contained in:
dandds 2018-09-10 12:01:30 -04:00
parent ebac93bc23
commit 139103b2ce
3 changed files with 8 additions and 58 deletions

View File

@ -1,50 +0,0 @@
"""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

@ -1,6 +1,6 @@
from wtforms.fields.html5 import EmailField, TelField
from wtforms.fields import StringField, TextAreaField
from wtforms.validators import Required, Email
from wtforms.validators import Email
from .forms import ValidatedForm
from .validators import Alphabet, PhoneNumber
@ -8,11 +8,11 @@ from .validators import Alphabet, PhoneNumber
class CCPOReviewForm(ValidatedForm):
comments = TextAreaField("Comments (optional)")
fname_mao = StringField("First Name", validators=[Required(), Alphabet()])
lname_mao = StringField("Last Name", validators=[Required(), Alphabet()])
fname_mao = StringField("First Name (optional)", validators=[Alphabet()])
lname_mao = StringField("Last Name (optional)", validators=[Alphabet()])
email_mao = EmailField("Mission Owner e-mail (optional)", validators=[Email()])
phone_mao = TelField(
"Mission Owner phone number (optional)", validators=[PhoneNumber()]
)
fname_ccpo = StringField("First Name", validators=[Required(), Alphabet()])
lname_ccpo = StringField("Last Name", validators=[Required(), Alphabet()])
fname_ccpo = StringField("First Name (optional)", validators=[Alphabet()])
lname_ccpo = StringField("Last Name (optional)", validators=[Alphabet()])

View File

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