mirror of
https://github.com/GSA/notifications-api.git
synced 2026-07-16 11:20:41 -04:00
Added a boolean column to templates called is_letter_contact_blank.
If is_letter_contact_blank then the user has set the letter contact block to be blank on purpose ELSE IF is_letter_contact_blank is false THEN use the template default IF template default is blank THEN the service_letter_contact is blank use the service default
This commit is contained in:
@@ -578,6 +578,10 @@ 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):
|
||||
|
||||
@@ -120,7 +120,6 @@ def get_template_by_id_and_service_id(service_id, template_id):
|
||||
def preview_template_by_id_and_service_id(service_id, template_id):
|
||||
fetched_template = dao_get_template_by_id_and_service_id(template_id=template_id, service_id=service_id)
|
||||
data = template_schema.dump(fetched_template).data
|
||||
print(data)
|
||||
template_object = get_template_instance(data, values=request.args.to_dict())
|
||||
|
||||
if template_object.missing_data:
|
||||
|
||||
Reference in New Issue
Block a user