Fix empty folder message

Sometimes, when filtering the view by template type, the message was
saying the folder was empty, when really it should have been saying that
there were no templates of the ‘type’ you’re looking for, eg:
> There are no email templates in this folder

This was because it was looking at the filtered list of templates, not
all templates to determine whether a folder was really empty.
This commit is contained in:
Chris Hill-Scott
2019-02-05 13:49:15 +00:00
parent 84e458ba78
commit 34f509af11
2 changed files with 21 additions and 3 deletions

View File

@@ -24,10 +24,10 @@ class TemplateList():
yield TemplateListFolder(
item,
folders=self.service.get_template_folders(
self.template_type, item['id']
template_type, item['id']
),
templates=self.service.get_templates(
self.template_type, item['id']
template_type, item['id']
),
ancestors=ancestors,
service_id=self.service.id,
@@ -38,7 +38,7 @@ class TemplateList():
yield sub_item
for item in self.service.get_templates(
self.template_type, template_folder_id
template_type, template_folder_id
):
yield TemplateListTemplate(
item,