mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
Merge pull request #1545 from alphagov/revert_is_blank-code
Because life is difficult today...
This commit is contained in:
@@ -582,10 +582,6 @@ class TemplateBase(db.Model):
|
||||
content = db.Column(db.Text, nullable=False)
|
||||
archived = db.Column(db.Boolean, nullable=False, default=False)
|
||||
subject = db.Column(db.Text)
|
||||
is_letter_contact_blank = db.Column(db.Boolean, nullable=False, default=False)
|
||||
|
||||
# if is_letter_contact = True then service_letter_contact must be null.
|
||||
CheckConstraint("Not(is_letter_contact_blank = True and service_letter_contact_id is not Null)")
|
||||
|
||||
@declared_attr
|
||||
def service_id(cls):
|
||||
|
||||
23
migrations/versions/0154_nullable_is_blank.py
Normal file
23
migrations/versions/0154_nullable_is_blank.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""
|
||||
|
||||
Revision ID: 0154_nullable_is_blank
|
||||
Revises: 0153_add_is_letter_contact_blank
|
||||
Create Date: 2018-01-05 15:49:36.522210
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
revision = '0154_nullable_is_blank'
|
||||
down_revision = '0153_add_is_letter_contact_blank'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.alter_column('templates', 'is_letter_contact_blank', nullable=True)
|
||||
op.alter_column('templates_history', 'is_letter_contact_blank', nullable=True)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.alter_column('templates', 'is_letter_contact_blank', nullable=True)
|
||||
op.alter_column('templates_history', 'is_letter_contact_blank', nullable=True)
|
||||
@@ -625,7 +625,6 @@ def test_get_template_reply_to(client, sample_letter_template):
|
||||
assert 'service_letter_contact_id' not in json_resp['data']
|
||||
assert json_resp['data']['reply_to'] == str(letter_contact.id)
|
||||
assert json_resp['data']['reply_to_text'] == letter_contact.contact_block
|
||||
assert not json_resp['data']['is_letter_contact_blank']
|
||||
|
||||
|
||||
def test_update_template_reply_to(client, sample_letter_template):
|
||||
|
||||
Reference in New Issue
Block a user