From 41e715a4044ed527a9cd8719c9434e1c48acb486 Mon Sep 17 00:00:00 2001 From: dandds Date: Wed, 20 Feb 2019 11:37:49 -0500 Subject: [PATCH] use full prefix for certifying official in SO review --- ...full_prefix_for_certifying_official_on_.py | 27 +++++++++++++++++++ atst/forms/dd_254.py | 19 ++++++------- atst/models/dd_254.py | 6 ++--- .../portfolios/task_orders/so_review.html | 6 ++--- tests/factories.py | 6 ++--- translations.yaml | 6 ++--- 6 files changed, 49 insertions(+), 21 deletions(-) create mode 100644 alembic/versions/fa3ba4049218_full_prefix_for_certifying_official_on_.py diff --git a/alembic/versions/fa3ba4049218_full_prefix_for_certifying_official_on_.py b/alembic/versions/fa3ba4049218_full_prefix_for_certifying_official_on_.py new file mode 100644 index 00000000..24971589 --- /dev/null +++ b/alembic/versions/fa3ba4049218_full_prefix_for_certifying_official_on_.py @@ -0,0 +1,27 @@ +"""full prefix for certifying official on dd 254 + +Revision ID: fa3ba4049218 +Revises: 7d9f070012ae +Create Date: 2019-02-20 11:19:39.655438 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'fa3ba4049218' +down_revision = '7d9f070012ae' +branch_labels = None +depends_on = None + + +def upgrade(): + op.alter_column("dd_254s", "co_address", new_column_name="certifying_official_address") + op.alter_column("dd_254s", "co_phone", new_column_name="certifying_official_phone") + op.alter_column("dd_254s", "co_title", new_column_name="certifying_official_title") + +def downgrade(): + op.alter_column("dd_254s", "certifying_official_address", new_column_name="co_address") + op.alter_column("dd_254s", "certifying_official_phone", new_column_name="co_phone") + op.alter_column("dd_254s", "certifying_official_title", new_column_name="co_title") diff --git a/atst/forms/dd_254.py b/atst/forms/dd_254.py index 40db0c2c..5d03f861 100644 --- a/atst/forms/dd_254.py +++ b/atst/forms/dd_254.py @@ -16,17 +16,18 @@ class DD254Form(CacheableForm): description=translate("forms.dd_254.certifying_official.description"), validators=[Required()], ) - co_title = StringField( - translate("forms.dd_254.co_title.label"), validators=[Required()] - ) - co_address = StringField( - translate("forms.dd_254.co_address.label"), - description=translate("forms.dd_254.co_address.description"), + certifying_official_title = StringField( + translate("forms.dd_254.certifying_official_title.label"), validators=[Required()], ) - co_phone = TelField( - translate("forms.dd_254.co_phone.label"), - description=translate("forms.dd_254.co_phone.description"), + certifying_official_address = StringField( + translate("forms.dd_254.certifying_official_address.label"), + description=translate("forms.dd_254.certifying_official_address.description"), + validators=[Required()], + ) + certifying_official_phone = TelField( + translate("forms.dd_254.certifying_official_phone.label"), + description=translate("forms.dd_254.certifying_official_phone.description"), validators=[Required(), PhoneNumber()], ) required_distribution = SelectMultipleField( diff --git a/atst/models/dd_254.py b/atst/models/dd_254.py index 8097773e..cd107d3e 100644 --- a/atst/models/dd_254.py +++ b/atst/models/dd_254.py @@ -11,9 +11,9 @@ class DD254(Base, mixins.TimestampsMixin): id = types.Id() certifying_official = Column(String) - co_title = Column(String) - co_address = Column(String) - co_phone = Column(String) + certifying_official_title = Column(String) + certifying_official_address = Column(String) + certifying_official_phone = Column(String) required_distribution = Column(ARRAY(String)) task_order = relationship("TaskOrder", uselist=False, backref="task_order") diff --git a/templates/portfolios/task_orders/so_review.html b/templates/portfolios/task_orders/so_review.html index b4ccd365..357cabce 100644 --- a/templates/portfolios/task_orders/so_review.html +++ b/templates/portfolios/task_orders/so_review.html @@ -22,9 +22,9 @@ {{ form.csrf_token }}

{{ "task_orders.so_review.certification" | translate }}

{{ TextInput(form.certifying_official) }} - {{ TextInput(form.co_title) }} - {{ TextInput(form.co_phone, placeholder='(123) 456-7890', validation='usPhone') }} - {{ TextInput(form.co_address, paragraph=True) }} + {{ TextInput(form.certifying_official_title) }} + {{ TextInput(form.certifying_official_phone, placeholder='(123) 456-7890', validation='usPhone') }} + {{ TextInput(form.certifying_official_address, paragraph=True) }}
diff --git a/tests/factories.py b/tests/factories.py index 079741c3..fd081e34 100644 --- a/tests/factories.py +++ b/tests/factories.py @@ -435,9 +435,9 @@ class DD254Factory(Base): model = DD254 certifying_official = factory.Faker("name") - co_title = factory.Faker("job") - co_address = factory.Faker("address") - co_phone = factory.LazyFunction(random_phone_number) + certifying_official_title = factory.Faker("job") + certifying_official_address = factory.Faker("address") + certifying_official_phone = factory.LazyFunction(random_phone_number) required_distribution = factory.LazyFunction( lambda: [random_choice(data.REQUIRED_DISTRIBUTIONS)] ) diff --git a/translations.yaml b/translations.yaml index d1cbcd57..4aa35d59 100644 --- a/translations.yaml +++ b/translations.yaml @@ -250,12 +250,12 @@ forms: certifying_official: label: Name of Certifying Official description: (First, Last, Middle) - co_title: + certifying_official_title: label: Title - co_address: + certifying_official_address: label: Address description: (Include ZIP Code) - co_phone: + certifying_official_phone: label: Telephone description: (Include Area Code) required_distribution: