Merge "Support Django 1.4, 1.5 and 1.6"

This commit is contained in:
Jenkins 2013-12-20 13:28:15 +00:00 committed by Gerrit Code Review
commit d1177f99cb
3 changed files with 17 additions and 1 deletions

View File

@ -48,3 +48,6 @@ USE_TZ = True
OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False
OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'domain'
# NOTE(saschpe): The openstack_auth.user.Token object isn't JSON-serializable ATM
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'

View File

@ -13,6 +13,7 @@
import logging
import django
from django import shortcuts
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME
@ -55,7 +56,13 @@ def login(request):
initial.update({'region': requested_region})
if request.method == "POST":
form = curry(Login, request)
# NOTE(saschpe): Since https://code.djangoproject.com/ticket/15198,
# the 'request' object is passed directly to AuthenticationForm in
# django.contrib.auth.views#login:
if django.VERSION >= (1, 6):
form = curry(Login)
else:
form = curry(Login, request)
else:
form = curry(Login, initial=initial)

View File

@ -16,6 +16,12 @@ deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python openstack_auth/tests/run_tests.py
[testenv:py27dj14]
deps = pbr>=0.5.21,<1.0
Django==1.4
python-keystoneclient>=0.3.2
-r{toxinidir}/test-requirements.txt
[testenv:pep8]
commands = flake8