Skip to content

Commit 05d47dc

Browse files
tbeadleRoss Mechanic
authored andcommitted
Honor a custom admin site_header in the listing and details pages. (#448)
1 parent 168eecc commit 05d47dc

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Authors
5151
- Ross Rogers
5252
- Steven Klass
5353
- Steeve Chailloux
54+
- Tommy Beadle (@tbeadle)
5455
- Trey Hunner
5556
- Ulysses Vilela
5657
- vnagendra

CHANGES.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ Changes
22
=======
33

44
Unreleased
5-
-----------
5+
----------
66
- Add `custom_model_name` parameter to the constructor of `HistoricalRecords` (gh-451)
7+
- Fix header on history pages when custom site_header is used (gh-448)
78

89
2.5.1 (2018-10-19)
910
------------------

simple_history/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def history_view(self, request, object_id, extra_context=None):
8484
'admin_user_view': admin_user_view,
8585
'history_list_display': history_list_display,
8686
}
87+
context.update(self.admin_site.each_context(request))
8788
context.update(extra_context or {})
8889
extra_kwargs = {}
8990
return render(request, self.object_history_template, context,
@@ -189,6 +190,7 @@ def history_form_view(self, request, object_id, version_id):
189190
'save_on_top': self.save_on_top,
190191
'root_path': getattr(self.admin_site, 'root_path', None),
191192
}
193+
context.update(self.admin_site.each_context(request))
192194
extra_kwargs = {}
193195
return render(request, self.object_history_form_template, context,
194196
**extra_kwargs)

simple_history/tests/tests/test_admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,7 @@ def test_history_form_view_without_getting_history(self):
467467
'save_on_top': admin.save_on_top,
468468
'root_path': getattr(admin_site, 'root_path', None),
469469
}
470+
context.update(admin_site.each_context(request))
470471
mock_render.assert_called_once_with(
471472
request, admin.object_history_form_template, context)
472473

@@ -522,6 +523,7 @@ def test_history_form_view_getting_history(self):
522523
'save_on_top': admin.save_on_top,
523524
'root_path': getattr(admin_site, 'root_path', None),
524525
}
526+
context.update(admin_site.each_context(request))
525527
mock_render.assert_called_once_with(
526528
request, admin.object_history_form_template, context)
527529

@@ -576,6 +578,7 @@ def test_history_form_view_getting_history_with_setting_off(self):
576578
'save_on_top': admin.save_on_top,
577579
'root_path': getattr(admin_site, 'root_path', None),
578580
}
581+
context.update(admin_site.each_context(request))
579582
mock_render.assert_called_once_with(
580583
request, admin.object_history_form_template, context)
581584

@@ -632,5 +635,6 @@ def test_history_form_view_getting_history_abstract_external(self):
632635
'save_on_top': admin.save_on_top,
633636
'root_path': getattr(admin_site, 'root_path', None),
634637
}
638+
context.update(admin_site.each_context(request))
635639
mock_render.assert_called_once_with(
636640
request, admin.object_history_form_template, context)

0 commit comments

Comments
 (0)