Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-openid-auth
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
django-openid-auth
Commits
aa195a21
Commit
aa195a21
authored
Apr 02, 2009
by
James Henstridge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some tweaks to the admin interface code, including exposing cleanup
actions (only available if using Django 1.1 though).
parent
60113c11
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
django_openid_auth/admin.py
+20
-2
No files found.
django_openid_auth/admin.py
View file @
aa195a21
from
django.contrib
import
admin
from
django_openid_auth.models
import
Nonce
,
Association
,
UserOpenID
from
django_openid_auth.store
import
DjangoOpenIDStore
class
NonceAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'server_url'
,
'timestamp'
)
actions
=
[
'cleanup_nonces'
]
def
cleanup_nonces
(
self
,
request
,
queryset
):
store
=
DjangoOpenIDStore
()
count
=
store
.
cleanupNonces
()
self
.
message_user
(
request
,
"
%
d expired nonces removed"
%
count
)
cleanup_nonces
.
short_description
=
"Clean up expired nonces"
admin
.
site
.
register
(
Nonce
,
NonceAdmin
)
class
AssociationAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'server_url'
,
'assoc_type'
)
list_filter
=
(
'assoc_type'
,)
search_fields
=
(
'server_url'
,)
actions
=
[
'cleanup_associations'
]
def
cleanup_associations
(
self
,
request
,
queryset
):
store
=
DjangoOpenIDStore
()
count
=
store
.
cleanupAssociations
()
self
.
message_user
(
request
,
"
%
d expired associations removed"
%
count
)
cleanup_associations
.
short_description
=
"Clean up expired associations"
admin
.
site
.
register
(
Association
,
AssociationAdmin
)
class
UserOpenIDAdmin
(
admin
.
ModelAdmin
):
list_display
=
(
'user'
,
'claimed_id'
,
'display_id'
)
search_fields
=
(
'
user
'
,)
list_display
=
(
'user'
,
'claimed_id'
)
search_fields
=
(
'
claimed_id
'
,)
admin
.
site
.
register
(
UserOpenID
,
UserOpenIDAdmin
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment