Skip to content

Commit 15271ca

Browse files
authored
Merge pull request #303 from WnP/patch-1
Use get_queryset rather than model.objects
2 parents dac00e0 + 2f07076 commit 15271ca

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Authors
3232
- Rod Xavier Bondoc
3333
- Ross Lote
3434
- Steven Klass
35+
- Steeve Chailloux
3536
- Trey Hunner
3637
- Ulysses Vilela
3738
- vnagendra

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changes
22
=======
33

4+
- Use get_queryset rather than model.objects in history_view. (gh-303)
5+
46
1.9.0 (2017-06-11)
57
------------------
68
- Add --batchsize option to the populate_history management command. (gh-231)

simple_history/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def history_view(self, request, object_id, extra_context=None):
6060
history_list_display = getattr(self, "history_list_display", [])
6161
# If no history was found, see whether this object even exists.
6262
try:
63-
obj = model.objects.get(**{pk_name: object_id})
63+
obj = self.get_queryset(request).get(**{pk_name: object_id})
6464
except model.DoesNotExist:
6565
try:
6666
obj = action_list.latest('history_date').instance

0 commit comments

Comments
 (0)