mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Fix references to TemplateType enum in the schema
Signed-off-by: Carlo Costino <carlo.costino@gsa.gov>
This commit is contained in:
4
Makefile
4
Makefile
@@ -112,6 +112,10 @@ test: ## Run tests and create coverage report
|
|||||||
poetry run coverage report -m --fail-under=93
|
poetry run coverage report -m --fail-under=93
|
||||||
poetry run coverage html -d .coverage_cache
|
poetry run coverage html -d .coverage_cache
|
||||||
|
|
||||||
|
.PHONY: test-debug
|
||||||
|
test-debug:
|
||||||
|
poetry run pytest --pdb -x
|
||||||
|
|
||||||
.PHONY: py-lock
|
.PHONY: py-lock
|
||||||
py-lock: ## Syncs dependencies and updates lock file without performing recursive internal updates
|
py-lock: ## Syncs dependencies and updates lock file without performing recursive internal updates
|
||||||
poetry lock --no-update
|
poetry lock --no-update
|
||||||
|
|||||||
@@ -375,6 +375,7 @@ class TemplateSchema(BaseTemplateSchema, UUIDsAsStringsMixin):
|
|||||||
created_by = field_for(models.Template, "created_by", required=True)
|
created_by = field_for(models.Template, "created_by", required=True)
|
||||||
process_type = field_for(models.Template, "process_type")
|
process_type = field_for(models.Template, "process_type")
|
||||||
redact_personalisation = fields.Method("redact")
|
redact_personalisation = fields.Method("redact")
|
||||||
|
template_type = auto_field(by_value=True)
|
||||||
created_at = FlexibleDateTime()
|
created_at = FlexibleDateTime()
|
||||||
updated_at = FlexibleDateTime()
|
updated_at = FlexibleDateTime()
|
||||||
|
|
||||||
@@ -419,6 +420,7 @@ class TemplateHistorySchema(BaseSchema):
|
|||||||
reply_to = fields.Method("get_reply_to", allow_none=True)
|
reply_to = fields.Method("get_reply_to", allow_none=True)
|
||||||
reply_to_text = fields.Method("get_reply_to_text", allow_none=True)
|
reply_to_text = fields.Method("get_reply_to_text", allow_none=True)
|
||||||
process_type = field_for(models.Template, "process_type")
|
process_type = field_for(models.Template, "process_type")
|
||||||
|
template_type = auto_field(by_value=True)
|
||||||
|
|
||||||
created_by = fields.Nested(
|
created_by = fields.Nested(
|
||||||
UserSchema, only=["id", "name", "email_address"], dump_only=True
|
UserSchema, only=["id", "name", "email_address"], dump_only=True
|
||||||
@@ -464,7 +466,7 @@ class JobSchema(BaseSchema):
|
|||||||
processing_started = FlexibleDateTime()
|
processing_started = FlexibleDateTime()
|
||||||
processing_finished = FlexibleDateTime()
|
processing_finished = FlexibleDateTime()
|
||||||
|
|
||||||
job_status = auto_field()
|
job_status = auto_field(by_value=True)
|
||||||
|
|
||||||
scheduled_for = FlexibleDateTime()
|
scheduled_for = FlexibleDateTime()
|
||||||
service_name = fields.Nested(
|
service_name = fields.Nested(
|
||||||
@@ -482,7 +484,7 @@ class JobSchema(BaseSchema):
|
|||||||
return job.template.name
|
return job.template.name
|
||||||
|
|
||||||
def get_template_type(self, job):
|
def get_template_type(self, job):
|
||||||
return job.template.template_type
|
return job.template.template_type.value
|
||||||
|
|
||||||
@validates("scheduled_for")
|
@validates("scheduled_for")
|
||||||
def validate_scheduled_for(self, value):
|
def validate_scheduled_for(self, value):
|
||||||
@@ -597,11 +599,12 @@ class NotificationWithPersonalisationSchema(NotificationWithTemplateSchema):
|
|||||||
created_at = auto_field()
|
created_at = auto_field()
|
||||||
id = auto_field()
|
id = auto_field()
|
||||||
job_row_number = auto_field()
|
job_row_number = auto_field()
|
||||||
notification_type = auto_field()
|
notification_type = auto_field(by_value=True)
|
||||||
reference = auto_field()
|
reference = auto_field()
|
||||||
sent_at = auto_field()
|
sent_at = auto_field()
|
||||||
sent_by = auto_field()
|
sent_by = auto_field()
|
||||||
status = auto_field()
|
status = auto_field()
|
||||||
|
template_type = auto_field(by_value=True)
|
||||||
template_version = auto_field()
|
template_version = auto_field()
|
||||||
to = auto_field()
|
to = auto_field()
|
||||||
updated_at = auto_field()
|
updated_at = auto_field()
|
||||||
|
|||||||
Reference in New Issue
Block a user