warehouse icon indicating copy to clipboard operation
warehouse copied to clipboard

Audit event prettification with a Jinja2 filter

Open woodruffw opened this issue 6 years ago • 1 comments

#6339 contains a long conditional to prettify audit events for user display. We should look into replacing it with a Jinja2 filter + some kind of lookup table for ease of maintenance and future event addition.

cc @nlhkabu

woodruffw avatar Aug 14 '19 15:08 woodruffw

In #15702 I used a set _mapping_ = { tag_name = "heading" ... } and then referred to that in the elif list to reduce some duplication. Maybe that could be a good first pass. Many of the messages could be accounted for that way.

While doing that PR, I found it annoying to have to go through the source files to find the additional data appended to each event ... but honestly, changing those enums to more structured/controlled objects with additional presentation data doesn't seem like ROI would be worth it.

jzohrab avatar Apr 03 '24 06:04 jzohrab