diff options
author | Thomas Goirand <thomas@goirand.fr> | 2014-09-09 01:28:06 +0000 |
---|---|---|
committer | Thomas Goirand <thomas@goirand.fr> | 2014-09-09 01:30:09 +0000 |
commit | 6d17375a9e481085a0d5a0219a29c77f7de5f108 (patch) | |
tree | 5750704fc175088bf36753aff869deceb8df6529 | |
parent | 5c8b0c78f28a9fdc8eea91bc0d89879523dd1959 (diff) | |
download | django_openstack_auth-6d17375a9e481085a0d5a0219a29c77f7de5f108.tar.gz |
Fix Django 1.7 compat
In Debian, we are going to release Jessie with Django 1.7,
which has just been released. Therefore, compatibility is
important for us.
This patch, which the Debian package already carries, fixes
2 small compatibility issues with Django 1.7. It is safe to
use openstack_auth with these patches and a lower version of
Django, which makes it safe to apply this patch.
Change-Id: I564cde889c56e12fc0fc1347537e66b576605a0d
-rw-r--r-- | openstack_auth/forms.py | 3 | ||||
-rw-r--r-- | openstack_auth/tests/run_tests.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/openstack_auth/forms.py b/openstack_auth/forms.py index 83a5a6a..2c8092c 100644 --- a/openstack_auth/forms.py +++ b/openstack_auth/forms.py @@ -100,5 +100,6 @@ class Login(django_auth_forms.AuthenticationForm): LOG.warning(msg) self.request.session.flush() raise forms.ValidationError(exc) - self.check_for_test_cookie() + if hasattr(self, 'check_for_test_cookie'): # Dropped in django 1.7 + self.check_for_test_cookie() return self.cleaned_data diff --git a/openstack_auth/tests/run_tests.py b/openstack_auth/tests/run_tests.py index 0252903..46c474c 100644 --- a/openstack_auth/tests/run_tests.py +++ b/openstack_auth/tests/run_tests.py @@ -21,6 +21,10 @@ os.environ['DJANGO_SETTINGS_MODULE'] = 'openstack_auth.tests.settings' from django.test import simple as test_simple +import django +if hasattr(django, 'setup'): + django.setup() + def run(*test_args): if not test_args: |