Compare commits

...

5 Commits

Author SHA1 Message Date
Arthur Hanson 58f50f46f9
Merge 2f6cc76acc into 835012f2ed 2024-04-26 19:29:41 -04:00
Arthur 835012f2ed 15838 use naturalday for date not naturaltime 2024-04-26 16:19:21 -04:00
Arthur 2f6cc76acc 15855 fix adding script as event rule 2024-04-26 09:31:46 -07:00
Arthur fc8abf9862 15855 fix adding script as event rule 2024-04-26 09:30:57 -07:00
Arthur ebbb92a630 15855 fix adding script as event rule 2024-04-26 09:29:51 -07:00
2 changed files with 4 additions and 3 deletions

View File

@ -118,7 +118,7 @@ def process_event_rules(event_rules, model_name, event, data, username=None, sna
# Enqueue a Job to record the script's execution
Job.enqueue(
"extras.scripts.run_script",
instance=script.module,
instance=event_rule.action_object,
name=script.name,
user=user,
data=data

View File

@ -5,7 +5,7 @@ import re
import yaml
from django import template
from django.contrib.contenttypes.models import ContentType
from django.contrib.humanize.templatetags.humanize import naturaltime
from django.contrib.humanize.templatetags.humanize import naturalday, naturaltime
from django.utils.html import escape
from django.utils.safestring import mark_safe
from markdown import markdown
@ -216,11 +216,12 @@ def render_yaml(value):
def isodate(value):
if type(value) is datetime.date:
text = value.isoformat()
return mark_safe(f'<span title="{naturalday(value)}">{text}</span>')
elif type(value) is datetime.datetime:
text = value.date().isoformat()
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
else:
return ''
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
@register.filter()