From 095fec4681401cfcdbfdb1483b328adc1ea8f9b6 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Thu, 13 Feb 2020 02:16:21 +0000 Subject: [PATCH] Don't register historical tables in admin interface --- apiserver/apiserver/api/admin.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apiserver/apiserver/api/admin.py b/apiserver/apiserver/api/admin.py index b7c5a3c..59882f6 100644 --- a/apiserver/apiserver/api/admin.py +++ b/apiserver/apiserver/api/admin.py @@ -5,6 +5,9 @@ from simple_history.admin import SimpleHistoryAdmin app_models = apps.get_app_config('api').get_models() for model in app_models: + if model._meta.model_name.startswith('historical'): + continue + try: admin.site.register(model, SimpleHistoryAdmin) except AlreadyRegistered: