Flush the sidebar cache when a new active role entity has been created.
authorLennard de Rijk <ljvderijk@gmail.com>
Mon, 26 Jan 2009 16:11:50 +0000
changeset 1001 2faa7f80e8b2
parent 1000 9af147fc1f1c
child 1002 11a2aff6c3ad
Flush the sidebar cache when a new active role entity has been created. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/logic/models/role.py
--- a/app/soc/logic/models/role.py	Mon Jan 26 16:04:19 2009 +0000
+++ b/app/soc/logic/models/role.py	Mon Jan 26 16:11:50 2009 +0000
@@ -73,6 +73,13 @@
       sidebar.flush(entity.user.account)
 
     return True
+  
+  def _onCreate(self, entity):
+    """Flush the sidebar cache when a new active role entity has been created.
+    """
+
+    if entity.state == 'active':
+      sidebar.flush(entity.user.account)
 
 
 logic = Logic()