Skip to content

Commit 3b7a3fd

Browse files
JimGomez48Ross Mechanic
authored andcommitted
Issue #427 added history_change_reason to the history list view as a default. (#458)
1 parent 882ff36 commit 3b7a3fd

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ Authors
6868
- Adnan Umer (@uadnan)
6969
- Jonathan Zvesper (@zvesp)
7070
- Matheus Cansian (@mscansian)
71+
- Jim Gomez
7172

7273
Background
7374
==========

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Unreleased
55
-----------
66
- Add `'+'` as the `history_type` for each instance in `bulk_history_create` (gh-449)
77
- Add support for `history_change_reason` for each instance in `bulk_history_create` (gh-449)
8+
- Add `history_change_reason` in the history list view under the `Change reason` display name
89

910
2.5.0 (2018-10-18)
1011
------------------

simple_history/templates/simple_history/_object_history_list.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<th scope="col">{% trans 'Date/time' %}</th>
1414
<th scope="col">{% trans 'Comment' %}</th>
1515
<th scope="col">{% trans 'Changed by' %}</th>
16+
<th scope="col">{% trans 'Change reason' %}</th>
1617
</tr>
1718
</thead>
1819
<tbody>
@@ -36,6 +37,9 @@
3637
{% trans "None" %}
3738
{% endif %}
3839
</td>
40+
<td>
41+
{{ action.history_change_reason }}
42+
</td>
3943
</tr>
4044
{% endfor %}
4145
</tbody>

simple_history/tests/tests/test_admin.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ def test_history_list(self):
7171
self.assertEqual(model_name, 'customuser')
7272
self.login()
7373
poll = Poll(question="why?", pub_date=today)
74+
poll.changeReason = 'A random test reason'
7475
poll._history_user = self.user
7576
poll.save()
77+
7678
response = self.app.get(get_history_url(poll))
7779
self.assertIn(get_history_url(poll, 0), response.unicode_normal_body)
7880
self.assertIn("Poll object", response.unicode_normal_body)
7981
self.assertIn("Created", response.unicode_normal_body)
82+
self.assertIn("Changed by", response.unicode_normal_body)
83+
self.assertIn("Change reason", response.unicode_normal_body)
84+
self.assertIn("A random test reason", response.unicode_normal_body)
8085
self.assertIn(self.user.username, response.unicode_normal_body)
8186

8287
def test_history_list_custom_fields(self):

0 commit comments

Comments
 (0)