Skip to content

Commit 534a8d3

Browse files
committed
Reverted last commit as it leads to test failures. Doubtful if these actually can occur in production, but tests will have to be re-written before using the added caching.
- Legacy-Id: 12220
1 parent e1cadcb commit 534a8d3

1 file changed

Lines changed: 6 additions & 15 deletions

File tree

ietf/meeting/models.py

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,9 +1004,8 @@ def get_material(self, material_type, only_one):
10041004
for d in l:
10051005
d.meeting_related = lambda: True
10061006
else:
1007-
if not hasattr(self, '_cached_materials'):
1008-
self._cached_materials = self.materials.exclude(states__slug='deleted').order_by('sessionpresentation__order')
1009-
l = self._cached_materials.filter(type=material_type).exclude(states__type=material_type)
1007+
l = self.materials.filter(type=material_type).exclude(states__type=material_type, states__slug='deleted').order_by('sessionpresentation__order')
1008+
10101009
if only_one:
10111010
if l:
10121011
return l[0]
@@ -1021,29 +1020,21 @@ def agenda(self):
10211020
return self._agenda_cache
10221021

10231022
def minutes(self):
1024-
if not hasattr(self, "_minutes_cache"):
1025-
self._minutes_cache = self.get_material("minutes", only_one=True)
1026-
return self._minutes_cache
1023+
return self.get_material("minutes", only_one=True)
10271024

10281025
def recordings(self):
1029-
if not hasattr(self, "_recordings_cache"):
1030-
self._recordings_cache = list(self.get_material("recording", only_one=False))
1031-
return self._recordings_cache
1026+
return list(self.get_material("recording", only_one=False))
10321027

10331028
def bluesheets(self):
1034-
if not hasattr(self, "_bluesheets_cache"):
1035-
self._bluesheets_cache = list(self.get_material("bluesheets", only_one=False))
1036-
return self._bluesheets_cache
1029+
return list(self.get_material("bluesheets", only_one=False))
10371030

10381031
def slides(self):
10391032
if not hasattr(self, "_slides_cache"):
10401033
self._slides_cache = list(self.get_material("slides", only_one=False))
10411034
return self._slides_cache
10421035

10431036
def drafts(self):
1044-
if not hasattr(self, "_drafts_cache"):
1045-
self._drafts_cache = list(self.materials.filter(type='draft'))
1046-
return self._drafts_cache
1037+
return list(self.materials.filter(type='draft'))
10471038

10481039
def all_meeting_sessions_for_group(self):
10491040
#sessions = [s for s in self.meeting.session_set.filter(group=self.group,type=self.type) if s.official_timeslotassignment()]

0 commit comments

Comments
 (0)