06/18 Update api/api/templates.py for iOS app to show active template only
This commit is contained in:
@@ -37,6 +37,7 @@ def _template_summary_payload(template: InspectionTemplate) -> dict:
|
|||||||
'name': template.name,
|
'name': template.name,
|
||||||
'description': template.description or '',
|
'description': template.description or '',
|
||||||
'frequency': template.frequency or '',
|
'frequency': template.frequency or '',
|
||||||
|
'is_active': template.active,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +89,7 @@ def list_templates():
|
|||||||
|
|
||||||
templates = (
|
templates = (
|
||||||
InspectionTemplate.query
|
InspectionTemplate.query
|
||||||
|
.filter_by(active=True)
|
||||||
.order_by(InspectionTemplate.name)
|
.order_by(InspectionTemplate.name)
|
||||||
.all()
|
.all()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user