only return unarchived templates when getting all templates

get_specific_template functions happily return archived templates
This commit is contained in:
Leo Hemsted
2016-05-23 14:00:28 +01:00
parent a436ff32a1
commit 5ebae9c66c
2 changed files with 26 additions and 1 deletions

View File

@@ -42,7 +42,8 @@ def dao_get_template_by_id(template_id, version=None):
def dao_get_all_templates_for_service(service_id):
return Template.query.filter_by(
service=Service.query.get(service_id)
service_id=service_id,
archived=False
).order_by(
asc(Template.updated_at), asc(Template.created_at)
).all()