mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Reuse TemplateList class when deleting a folder
Part of moving "get_template_folders" et al. into TemplateList so we can cache it more effectively. This is slightly less efficient as iterating a TemplateList will instantiate an object for each item in the folder; but the difference is minimal. Note that: - The default template_type for TemplateList is "all". - We need to pass realistic template "JSON" in the test now.
This commit is contained in:
@@ -650,12 +650,6 @@ class Service(JSONModel, SortByNameMixin):
|
||||
template,
|
||||
]
|
||||
|
||||
def get_template_folders_and_templates(self, template_type, template_folder_id):
|
||||
return (
|
||||
self.get_templates(template_type, template_folder_id)
|
||||
+ self.get_template_folders(template_type, template_folder_id)
|
||||
)
|
||||
|
||||
@property
|
||||
def count_of_templates_and_folders(self):
|
||||
return len(self.all_templates + self.all_template_folders)
|
||||
|
||||
Reference in New Issue
Block a user