<commit_before>from django.contrib import admin
from django.contrib.auth.models import Group

from .models import Editor


class ContributorMixin(admin.ModelAdmin):
    def save_model(self, request, obj, form, change):
        super(ContributorMixin, self).save_model(request, obj, form, change)
        if not change:
            obj.submitted_by = request.user
        obj.edited_by.add(request.user)
        obj.save()


class EditorAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': (('username', 'password'),)}),
        ('Personal Information', {'fields': (('name', 'email'),)}),
        ('Important Dates', {
            'classes': ('grp-collapse grp-open',),
            'fields': ('started', 'last_login', 'active_since')
        }),
        ('Permissions', {
            'classes': ('grp-collapse grp-open',),
            'fields': (('is_active', 'is_staff', 'is_superuser'),)
        }),
        ('OAuth', {
            'classes': ('grp-collapse grp-closed',),
            'fields': ('base_id', ('access_token', 'refresh_token', 'token_expiration'))
        })
    )
    list_display = ['username', 'name', 'email', 'is_active', 'is_staff', 'is_superuser', 'base_id', 'access_token']
    list_filter = ['is_active', 'is_staff', 'is_superuser']
admin.site.register(Editor, EditorAdmin)
admin.site.unregister(Group)
<commit_msg>Move this to the bottom...<commit_after>from django.contrib import admin
from django.contrib.auth.models import Group

from .models import Editor


class ContributorMixin(admin.ModelAdmin):
    def save_model(self, request, obj, form, change):
        if not change:
            obj.submitted_by = request.user
        obj.edited_by.add(request.user)
        obj.save()
        super(ContributorMixin, self).save_model(request, obj, form, change)


class EditorAdmin(admin.ModelAdmin):
    fieldsets = (
        (None, {'fields': (('username', 'password'),)}),
        ('Personal Information', {'fields': (('name', 'email'),)}),
        ('Important Dates', {
            'classes': ('grp-collapse grp-open',),
            'fields': ('started', 'last_login', 'active_since')
        }),
        ('Permissions', {
            'classes': ('grp-collapse grp-open',),
            'fields': (('is_active', 'is_staff', 'is_superuser'),)
        }),
        ('OAuth', {
            'classes': ('grp-collapse grp-closed',),
            'fields': ('base_id', ('access_token', 'refresh_token', 'token_expiration'))
        })
    )
    list_display = ['username', 'name', 'email', 'is_active', 'is_staff', 'is_superuser', 'base_id', 'access_token']
    list_filter = ['is_active', 'is_staff', 'is_superuser']
admin.site.register(Editor, EditorAdmin)
admin.site.unregister(Group)

{'fraction_non_alphanumeric': 0.1744399559309585, 'fraction_numerical': 0.0, 'mean_word_length': 3.1148036253776437, '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': '1862307', 'n_tokens_mistral': 830, 'n_tokens_neox': 827, 'n_words': 176}