Reuse TemplateList to display move-to options

This is slightly less efficient than getting the folder dicts from
"get_user_template_folders" directly, since:

- TemplateList returns both templates and folders.
- TemplateList encapsulates the dicts in model classes.

We'll compensate for this later on:

- We'll introduce a new caching approach to make the call fast.
- We'll expose a property to avoid the "if" in the comprehension.
This commit is contained in:
Ben Thorner
2022-05-26 16:46:17 +01:00
parent f500db44f1
commit ad4ef12251
2 changed files with 6 additions and 1 deletions

View File

@@ -157,6 +157,7 @@ class TemplateListFolder(TemplateListItem):
service_id,
):
super().__init__(folder, ancestors)
self.folder = folder
self.service_id = service_id
self.number_of_templates = len(templates)
self.number_of_folders = len(folders)