Skip to content

Commit 6d36990

Browse files
committed
Changed the cache-filling code for doc.get_state() to avoid a period where the cache is seen as valid but empty. Addresses an issue where documents occasionally appear to be in an unexpected state.
- Legacy-Id: 18564
1 parent 020d560 commit 6d36990

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ietf/doc/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ def get_state(self, state_type=None):
291291
state_type = self.type_id
292292

293293
if not hasattr(self, "state_cache") or self.state_cache == None:
294-
self.state_cache = {}
294+
state_cache = {}
295295
for s in self.states.all():
296-
self.state_cache[s.type_id] = s
296+
state_cache[s.type_id] = s
297+
self.state_cache = state_cache
297298

298299
return self.state_cache.get(state_type, None)
299300

0 commit comments

Comments
 (0)