<commit_before>from django.contrib import admin

from users.models import UserBan


class UserBanAdmin(admin.ModelAdmin):
    fields = ('user', 'by', 'reason', 'is_active')
    list_display = ('user', 'by', 'reason')
    list_filter = ('is_active',)
    search_fields = ('user', 'reason')


admin.site.register(UserBan, UserBanAdmin)<commit_msg>Admin interface for user bans should use raw_id_fields instead of loading all the users.<commit_after>from django.contrib import admin

from users.models import UserBan


class UserBanAdmin(admin.ModelAdmin):
    fields = ('user', 'by', 'reason', 'is_active')
    list_display = ('user', 'by', 'reason')
    list_filter = ('is_active',)
    raw_id_fields = ('user',)
    search_fields = ('user', 'reason')


admin.site.register(UserBan, UserBanAdmin)
{'fraction_non_alphanumeric': 0.1421383647798742, 'fraction_numerical': 0.0, 'mean_word_length': 5.03030303030303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5173705', 'n_tokens_mistral': 257, 'n_tokens_neox': 242, 'n_words': 66}