Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Dec 16, 2021
1 parent 70bd0c9 commit 27d662f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions oauth2_provider/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
get_refresh_token_model,
)

has_email = hasattr(get_user_model(), 'email')

has_email = hasattr(get_user_model(), "email")


class ApplicationAdmin(admin.ModelAdmin):
Expand Down Expand Up @@ -42,13 +43,11 @@ class GrantAdmin(admin.ModelAdmin):

class IDTokenAdmin(admin.ModelAdmin):
list_display = ("jti", "user", "application", "expires")
raw_id_fields = ("user", )
raw_id_fields = ("user",)
search_fields = ("token",) + (("user__email",) if has_email else ())
list_filter = ("application",)




class RefreshTokenAdmin(admin.ModelAdmin):
list_display = ("token", "user", "application")
raw_id_fields = ("user", "access_token")
Expand Down

0 comments on commit 27d662f

Please sign in to comment.