Skip to content

Commit

Permalink
Merge pull request #80 from eduNEXT/anmrdz/improve_performance_admin
Browse files Browse the repository at this point in the history
Improve load times of Django Admin Views
  • Loading branch information
anmrdz authored Oct 25, 2019
2 parents e1a5090 + a72dcae commit a4f0a98
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions eox_core/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,20 @@

class UserSignupSourceAdmin(admin.ModelAdmin):
""" Admin interface for the UserSignupSource model. """
list_display = ('user', 'site',)
list_filter = ('user', 'site',)
list_display = ('user', 'site')
list_per_page = 20
raw_id_fields = ('user',)
search_fields = ('site', 'user__username', 'user__email',)
# Prevent expensive duplicated COUNT query
show_full_result_count = False


class LoginFailuresAdmin(admin.ModelAdmin):
""" Admin interface for the LoginFailures model. """
list_display = ('user', 'failure_count', 'lockout_until',)
list_filter = ('user', 'lockout_until',)
search_fields = ('user__username', 'user__email',)
# Prevent expensive duplicated COUNT query
show_full_result_count = False


class RedirectionAdmin(admin.ModelAdmin):
Expand Down

0 comments on commit a4f0a98

Please sign in to comment.