Add a simple changelog to the events #26

Merged
heinzel merged 7 commits from changelog into master 2020-11-03 12:34:30 +01:00
2 changed files with 6 additions and 2 deletions
Showing only changes of commit 96d6dc72fb - Show all commits

View File

@@ -198,7 +198,7 @@
<a role="button" href="#collapseStatusLog" data-toggle="collapse" <a role="button" href="#collapseStatusLog" data-toggle="collapse"
data-parent="#log-accordion" aria-expanded="true" data-parent="#log-accordion" aria-expanded="true"
aria-controls="collapseStatusLog"> aria-controls="collapseStatusLog">
Status-Log Status-Flags
</a> </a>
</h5> </h5>
</div> </div>

View File

@@ -60,7 +60,11 @@ def render_event_changelog(event):
subchanges = json.loads(change.content) subchanges = json.loads(change.content)
for subchange in subchanges: for subchange in subchanges:
field_label = event._meta.get_field(subchange['field']).verbose_name field_label = event._meta.get_field(subchange['field']).verbose_name
if len(subchange['refer']) + len(subchange['current']) > 20: try:
is_long_strings = (len(subchange['refer']) + len(subchange['current'])) > 20
except TypeError:
is_long_strings = False
if is_long_strings:
separator1 = u'<br />' separator1 = u'<br />'
separator2 = u'<br />' separator2 = u'<br />'
else: else: