Skip to content

Commit 84c355e

Browse files
committed
Added caching to some meeting methods which are called multiple times when generating the IETF agenda.
- Legacy-Id: 11413
1 parent df84098 commit 84c355e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ietf/meeting/models.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,9 @@ def get_material(self, material_type, only_one):
935935
return l
936936

937937
def agenda(self):
938-
return self.get_material("agenda", only_one=True)
938+
if not hasattr(self, "_agenda_cache"):
939+
self._agenda_cache = self.get_material("agenda", only_one=True)
940+
return self._agenda_cache
939941

940942
def minutes(self):
941943
return self.get_material("minutes", only_one=True)
@@ -944,7 +946,9 @@ def recordings(self):
944946
return list(self.get_material("recording", only_one=False))
945947

946948
def slides(self):
947-
return list(self.get_material("slides", only_one=False))
949+
if not hasattr(self, "_slides_cache"):
950+
self._slides_cache = list(self.get_material("slides", only_one=False))
951+
return self._slides_cache
948952

949953
def drafts(self):
950954
return list(self.materials.filter(type='draft'))

0 commit comments

Comments
 (0)