Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion oauth2_provider/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,22 @@ class ApplicationAdmin(admin.ModelAdmin):
class GrantAdmin(admin.ModelAdmin):
list_display = ("code", "application", "user", "expires")
raw_id_fields = ("user", )
search_fields = ("code", "user__email")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... You sure this won't break things it user model doesn't have a email field?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Rest looks good.

list_filter = ("application",)


class AccessTokenAdmin(admin.ModelAdmin):
list_display = ("token", "user", "application", "expires")
raw_id_fields = ("user", )
raw_id_fields = ("user", "source_refresh_token")
search_fields = ("token", "user__email")
list_filter = ("application",)


class RefreshTokenAdmin(admin.ModelAdmin):
list_display = ("token", "user", "application")
raw_id_fields = ("user", "access_token")
search_fields = ("token", "user__email")
list_filter = ("application",)


Application = get_application_model()
Expand Down