1. Alexey Boriskin
  2. django-versioning

Commits

Ivan Zakrevsky  committed cde8563

configurable admin.autodiscover()

  • Participants
  • Parent commits 69b1f8a
  • Branches master

Comments (0)

Files changed (1)

File versioning/admin.py

View file
  • Ignore whitespace
+from django.conf import settings
 from django.contrib import admin
 
 from . import _registry
     return AdminVersionable
 
 
-def patch_admin_models():
+def autodiscover():
     """Adds RevisionInline for revisionable models."""
     for model in _registry:
         if model in admin.site._registry:
             admin.site.unregister(model)
             admin.site.register(model, make_admin_versionable(cls))
 
-patch_admin_models()
+if getattr(settings, 'VERSIONING_ADMIN_AUTODISCOVER', True):
+    autodiscover()