From e593dcb5d8c1d927910a2f0a0d86ab045695c290 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 12 Nov 2019 00:23:18 -0400 Subject: [PATCH] Add missing Event class cache invalidation Needed when calling the refresh() method. Otherwise null StoredEvent instances will be returned. Signed-off-by: Roberto Rosario --- HISTORY.rst | 2 ++ mayan/apps/events/classes.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index ae149a759e..2ecc02d918 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -16,6 +16,8 @@ - Fix NamedMultiWidget issue on Python 3. Affects document checkout form. GitLab issue #683. Thanks to John Bentley (@johnbentleyii) for the report. +- Add missing Event class cache invalidation when + calling the refresh() method. 3.2.9 (2019-11-03) ================== diff --git a/mayan/apps/events/classes.py b/mayan/apps/events/classes.py index 66feb551b8..320f02a3a4 100644 --- a/mayan/apps/events/classes.py +++ b/mayan/apps/events/classes.py @@ -73,6 +73,9 @@ class EventType(object): @classmethod def refresh(cls): for event_type in cls.all(): + # Invalidate cache and recreate store events while repopulating + # cache + event_type.stored_event_type = None event_type.get_stored_event_type() def __init__(self, namespace, name, label):