~ubuntuone-pqm-team/django-openid-auth/trunk

« back to all changes in this revision

Viewing changes to django_openid_auth/admin.py

  • Committer: Ricardo Kirkner
  • Date: 2017-03-31 17:25:44 UTC
  • mto: This revision was merged to the branch mainline in revision 128.
  • Revision ID: ricardo.kirkner@canonical.com-20170331172544-iwtx4l1jisbhiw5v
support python 2.7 and 3.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
from __future__ import unicode_literals
31
31
 
32
 
from urllib import urlencode
33
 
from urlparse import parse_qsl, urlparse
 
32
try:
 
33
    from urllib.parse import parse_qsl, urlencode, urlparse
 
34
except ImportError:
 
35
    from urllib import urlencode
 
36
    from urlparse import parse_qsl, urlparse
34
37
 
35
38
from django.conf import settings
36
39
from django.contrib import admin
50
53
        self.message_user(request, "%d expired nonces removed" % count)
51
54
    cleanup_nonces.short_description = "Clean up expired nonces"
52
55
 
 
56
 
53
57
admin.site.register(Nonce, NonceAdmin)
54
58
 
55
59
 
65
69
        self.message_user(request, "%d expired associations removed" % count)
66
70
    cleanup_associations.short_description = "Clean up expired associations"
67
71
 
 
72
 
68
73
admin.site.register(Association, AssociationAdmin)
69
74
 
70
75
 
73
78
    list_display = ('user', 'claimed_id')
74
79
    search_fields = ('claimed_id',)
75
80
 
 
81
 
76
82
admin.site.register(UserOpenID, UserOpenIDAdmin)
77
83
 
78
84