fnp
/
django-cas-provider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0ea3dae
)
Restore Py2.5 compatibility
author
Gunnlaugur Thor Briem
<gunnlaugur@gmail.com>
Wed, 8 Jun 2011 21:25:31 +0000
(21:25 +0000)
committer
Gunnlaugur Thor Briem
<gunnlaugur@gmail.com>
Wed, 8 Jun 2011 21:25:31 +0000
(21:25 +0000)
cas_provider/models.py
patch
|
blob
|
history
diff --git
a/cas_provider/models.py
b/cas_provider/models.py
index
ec4b695
..
2075c2e
100644
(file)
--- a/
cas_provider/models.py
+++ b/
cas_provider/models.py
@@
-6,6
+6,12
@@
import string
import urllib
import urlparse
import urllib
import urlparse
+if hasattr(urlparse, 'parse_qs'):
+ parse_qs = urlparse.parse_qs
+else:
+ # Python <2.6 compatibility
+ from cgi import parse_qs
+
__all__ = ['ServiceTicket', 'LoginTicket']
__all__ = ['ServiceTicket', 'LoginTicket']
@@
-42,7
+48,7
@@
class ServiceTicket(BaseTicket):
def get_redirect_url(self):
parsed = urlparse.urlparse(self.service)
def get_redirect_url(self):
parsed = urlparse.urlparse(self.service)
- query =
urlparse.
parse_qs(parsed.query)
+ query = parse_qs(parsed.query)
query['ticket'] = [self.ticket]
query = [ ((k, v) if len(v) > 1 else (k, v[0])) for k, v in query.iteritems()]
parsed = urlparse.ParseResult(parsed.scheme, parsed.netloc,
query['ticket'] = [self.ticket]
query = [ ((k, v) if len(v) > 1 else (k, v[0])) for k, v in query.iteritems()]
parsed = urlparse.ParseResult(parsed.scheme, parsed.netloc,