Browse Source

Fix #2046 (#2047)

* Fix #2046

* Add requirements
pull/2056/head
Victor Fabre 7 years ago
committed by Edward
parent
commit
fd21134dd6
  1. 1
      requirements/requirements.txt
  2. 1
      sapl/settings.py
  3. 3
      sapl/utils.py

1
requirements/requirements.txt

@ -36,3 +36,4 @@ django-reversion==2.0.8
WeasyPrint==0.42 WeasyPrint==0.42
whoosh==2.7.4 whoosh==2.7.4
django-speedinfo==1.3.5 django-speedinfo==1.3.5
django-reversion-compare==0.8.4

1
sapl/settings.py

@ -87,6 +87,7 @@ INSTALLED_APPS = (
'sass_processor', 'sass_processor',
'rest_framework', 'rest_framework',
'reversion', 'reversion',
'reversion_compare',
'whoosh', 'whoosh',
'speedinfo', 'speedinfo',

3
sapl/utils.py

@ -25,6 +25,7 @@ from django_filters.filterset import STRICTNESS
from easy_thumbnails import source_generators from easy_thumbnails import source_generators
from floppyforms import ClearableFileInput from floppyforms import ClearableFileInput
from reversion.admin import VersionAdmin from reversion.admin import VersionAdmin
from reversion_compare.admin import CompareVersionAdmin
from unipath.path import Path from unipath.path import Path
from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row from sapl.crispy_layout_mixin import SaplFormLayout, form_actions, to_row
@ -228,7 +229,7 @@ def register_all_models_in_admin(module_name):
appname = appname[1] if appname[0] == 'sapl' else appname[0] appname = appname[1] if appname[0] == 'sapl' else appname[0]
app = apps.get_app_config(appname) app = apps.get_app_config(appname)
for model in app.get_models(): for model in app.get_models():
class CustomModelAdmin(VersionAdmin): class CustomModelAdmin(CompareVersionAdmin):
list_display = [f.name for f in model._meta.fields list_display = [f.name for f in model._meta.fields
if f.name != 'id'] if f.name != 'id']

Loading…
Cancel
Save