logentry user column doesn t get altered to expect a uuid so set an integer manually to avoid causing an error logentry user column doesn t get altered to expect a uuid so set an integer manually to avoid causing an error
from django.contrib import admin
from django.contrib.auth import get_user_model
from django.contrib.auth.admin import UserAdmin
from django.urls import path

site = admin.AdminSite(name="custom_user_admin")


class CustomUserAdmin(UserAdmin):
    def log_change(self, request, obj, message):
        
        
        original_pk = request.user.pk
        request.user.pk = 1
        super().log_change(request, obj, message)
        request.user.pk = original_pk


site.register(get_user_model(), CustomUserAdmin)

urlpatterns = [
    path("admin/", site.urls),
]