[Django]-Django-reversion and django-reversion-compare with User model

8👍

The auth.User model is already registered in the django admin that’s why you see the error. To avoid it you have two options:

A. Unregister the User admin and then register it again as a VersionAdmin: Something like this:

from django.contrib import admin
from django.contrib.auth.models import User
from reversion.admin import VersionAdmin

admin.site.unregister(User) 
admin.site.register(User, VersionAdmin) 

B. Use the registration API of django-reversion (https://django-reversion.readthedocs.io/en/stable/api.html#registration-api) to register the model without modifying your admin, for example:

import reversion
from django.contrib.auth.models import User

reversion.register(User)

Leave a comment