mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 14:31:08 -05:00
Update migration files for Django 5.1.4; remove obsolete merge migrations and adjust history tracking context in templates
This commit is contained in:
@@ -249,10 +249,10 @@ class HistoryMixin:
|
||||
obj = self.get_object() # type: ignore
|
||||
|
||||
# Get historical records ordered by date if available
|
||||
history = getattr(obj, 'history', None)
|
||||
if history is not None:
|
||||
context['history'] = history.all().select_related('history_user').order_by('-history_date')
|
||||
else:
|
||||
try:
|
||||
# Use pghistory's get_history method
|
||||
context['history'] = obj.get_history()
|
||||
except (AttributeError, TypeError):
|
||||
context['history'] = []
|
||||
|
||||
# Get related edit submissions
|
||||
|
||||
Reference in New Issue
Block a user