]> 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 bf0b8f2400383ae950776737d38c9ce03a712685..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,7 +87,7 @@ 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' %("/".join(folderpath)), menu_items)