refactor: rename descriptor -> block within remaining xmodule

Co-authored-by: Agrendalath <piotr@surowiec.it>
This commit is contained in:
Pooja Kulkarni
2023-01-05 14:30:42 -05:00
committed by Agrendalath
parent ce94d896cf
commit 1950949c9e
15 changed files with 83 additions and 83 deletions

View File

@@ -21,13 +21,13 @@ log = logging.getLogger(__name__)
def all_templates():
"""
Returns all templates for enabled modules, grouped by descriptor type
Returns all templates for enabled modules, grouped by block type
"""
# TODO use memcache to memoize w/ expiration
templates = defaultdict(list)
for category, descriptor in XBlock.load_classes():
if not hasattr(descriptor, 'templates'):
for category, block in XBlock.load_classes():
if not hasattr(block, 'templates'):
continue
templates[category] = descriptor.templates()
templates[category] = block.templates()
return templates