Skip to content

Commit

Permalink
Merge pull request fangli#35 from pintor/master
Browse files Browse the repository at this point in the history
Import reverse from django.url for versions >= 2.0
  • Loading branch information
fangli authored Dec 29, 2017
2 parents e4216c2 + e953ca9 commit 275d56a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django_saml2_auth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down

0 comments on commit 275d56a

Please sign in to comment.