Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Use SortedDict to keep insert order in python 3

  • Loading branch information...
commit 4b058f35524b509d2ac27e71b3ec2af3bbab7c76 1 parent d21515d
@yakky yakky authored
Showing with 6 additions and 4 deletions.
  1. +4 −3 cms/toolbar/toolbar.py
  2. +2 −1  cms/toolbar_pool.py
View
7 cms/toolbar/toolbar.py
@@ -6,14 +6,15 @@
from cms.utils import get_language_from_request
from cms.utils.i18n import force_language
-from django.contrib.auth.forms import AuthenticationForm
from django import forms
+from django.conf import settings
from django.contrib.auth import login, logout
+from django.contrib.auth.forms import AuthenticationForm
from django.core.urlresolvers import resolve, Resolver404
from django.http import HttpResponseRedirect, HttpResponse
from django.middleware.csrf import get_token
from django.utils.translation import ugettext_lazy as _
-from django.conf import settings
+from django.utils.datastructures import SortedDict
class CMSToolbarLoginForm(AuthenticationForm):
@@ -77,7 +78,7 @@ def __init__(self, request):
self.view_name = ""
toolbars = toolbar_pool.get_toolbars()
- self.toolbars = {}
+ self.toolbars = SortedDict()
app_key = ''
for key in toolbars:
app_name = ".".join(key.split(".")[:-2])
View
3  cms/toolbar_pool.py
@@ -3,11 +3,12 @@
from cms.utils.conf import get_cms_setting
from cms.utils.django_load import load, iterload_objects
from django.core.exceptions import ImproperlyConfigured
+from django.utils.datastructures import SortedDict
class ToolbarPool(object):
def __init__(self):
- self.toolbars = {}
+ self.toolbars = SortedDict()
self.reverse = {}
self.discovered = False
self.force_register = False
Please sign in to comment.
Something went wrong with that request. Please try again.