summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-04-11 15:12:06 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:27 +0200
commit9d2e907f32f860947691c8eeda540149a35ef9a6 (patch)
treef9cb2ff7f0f534b2e6bd67493feb2da3a2b2580a /ishtar_common/models.py
parent1eab5ad6ef107b490b6af8ce31beafa265fcb3a4 (diff)
downloadIshtar-9d2e907f32f860947691c8eeda540149a35ef9a6.tar.bz2
Ishtar-9d2e907f32f860947691c8eeda540149a35ef9a6.zip
lazy evaluation of profile mapping
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 4d699bfd8..74151fa31 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -2620,6 +2620,13 @@ def get_current_profile(force=False):
return IshtarSiteProfile.get_current_profile(force=force)
+def _profile_mapping():
+ return get_current_profile().mapping
+
+
+profile_mapping = lazy(_profile_mapping)
+
+
def cached_site_changed(sender, **kwargs):
get_current_profile(force=True)
from ishtar_common.menus import Menu