From e953ca933060a5b030cb1f11d6385c9bc623e643 Mon Sep 17 00:00:00 2001 From: Roland Pinto Date: Wed, 20 Dec 2017 15:07:43 -0500 Subject: [PATCH] Import reverse from django.url for versions >= 2.0 --- django_saml2_auth/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/django_saml2_auth/views.py b/django_saml2_auth/views.py index 59bc413..c0bae12 100644 --- a/django_saml2_auth/views.py +++ b/django_saml2_auth/views.py @@ -46,7 +46,10 @@ def get_current_domain(r): def get_reverse(objs): '''In order to support different django version, I have to do this ''' - from django.core.urlresolvers import reverse + if parse_version(get_version()) >= parse_version('2.0'): + from django.urls import reverse + else: + from django.core.urlresolvers import reverse if objs.__class__.__name__ not in ['list', 'tuple']: objs = [objs]