]> git.sommitrealweird.co.uk Git - sommitrealweird.git/blobdiff - sommitrealweird/bpcms/context_processors.py
Changes for django 2.2
[sommitrealweird.git] / sommitrealweird / bpcms / context_processors.py
index c235c9b31e39db17b27da878d49a7eabada45517..e92e8cef2db13b0bacd88139c687fa12c2ed2dd9 100644 (file)
@@ -4,6 +4,7 @@ from django.core.cache import cache
 import re
 
 def content_menu(request):
+
     menu_items = cache.get('bpcms_mainmenu')
 
     if not menu_items:
@@ -32,7 +33,7 @@ def content_menu(request):
                 pass
 
         menu_items.sort( \
-            cmp=lambda x,y: cmp(x['title'].lower(), y['title'].lower()))
+            key=lambda x: x['title'].lower())
         cache.set('bpcms_mainmenu', menu_items, 3600)
 
     return {
@@ -86,9 +87,9 @@ def content_submenu(request):
                     )
 
         menu_items.sort( \
-            cmp=lambda x,y: cmp(x['title'].lower(), y['title'].lower()))
+            key=lambda x: x['title'].lower())
 
-        cache.set('bpcms_contentmenu_%s' %(folderpath), menu_items)
+        cache.set('bpcms_contentmenu_%s' %("/".join(folderpath)), menu_items)
 
     return {
         'content_submenu': menu_items,