Update migration files for Django 5.1.4; remove obsolete merge migrations and adjust history tracking context in templates

This commit is contained in:
pacnpal
2025-02-10 00:11:29 -05:00
parent 228eeeb3c8
commit 4b32580b13
44 changed files with 2353 additions and 2543 deletions

View File

@@ -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