Commit fbe57d5f authored by Dean Birch's avatar Dean Birch
Browse files

Only use get_change_message on Django > 1.10

Jessie still is on Django 1.8, so cannot use get_change_message.

Change-Id: I9f35e549cdf0f48058bd4458fe9e731fd49a3a38
parent 04ed780c
import django
import logging
import random
from django.contrib.admin.models import (
......@@ -621,12 +622,16 @@ class LogEntryTable(tables.Table):
change_message.orderable = False
def render_change_message(self, record):
if django.VERSION > (1, 10):
message = record.get_change_message()
else:
message = record.change_message
if record.is_change():
return record.get_change_message()
return message
elif record.is_addition():
return mark_safe('<span class="glyphicon glyphicon-plus text-success"></span> %s' % record.get_change_message())
return mark_safe('<span class="glyphicon glyphicon-plus text-success"></span> %s' % message)
else:
return mark_safe('<span class="glyphicon glyphicon-remove text-danger"></span> %s' % record.get_change_message())
return mark_safe('<span class="glyphicon glyphicon-remove text-danger"></span> %s' % message)
class Meta(LavaTable.Meta):
model = LogEntry
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment