Compare commits
5 Commits
8a9e428083
...
58f50f46f9
Author | SHA1 | Date |
---|---|---|
Arthur Hanson | 58f50f46f9 | |
Arthur | 835012f2ed | |
Arthur | 2f6cc76acc | |
Arthur | fc8abf9862 | |
Arthur | ebbb92a630 |
|
@ -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
|
# Enqueue a Job to record the script's execution
|
||||||
Job.enqueue(
|
Job.enqueue(
|
||||||
"extras.scripts.run_script",
|
"extras.scripts.run_script",
|
||||||
instance=script.module,
|
instance=event_rule.action_object,
|
||||||
name=script.name,
|
name=script.name,
|
||||||
user=user,
|
user=user,
|
||||||
data=data
|
data=data
|
||||||
|
|
|
@ -5,7 +5,7 @@ import re
|
||||||
import yaml
|
import yaml
|
||||||
from django import template
|
from django import template
|
||||||
from django.contrib.contenttypes.models import ContentType
|
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.html import escape
|
||||||
from django.utils.safestring import mark_safe
|
from django.utils.safestring import mark_safe
|
||||||
from markdown import markdown
|
from markdown import markdown
|
||||||
|
@ -216,11 +216,12 @@ def render_yaml(value):
|
||||||
def isodate(value):
|
def isodate(value):
|
||||||
if type(value) is datetime.date:
|
if type(value) is datetime.date:
|
||||||
text = value.isoformat()
|
text = value.isoformat()
|
||||||
|
return mark_safe(f'<span title="{naturalday(value)}">{text}</span>')
|
||||||
elif type(value) is datetime.datetime:
|
elif type(value) is datetime.datetime:
|
||||||
text = value.date().isoformat()
|
text = value.date().isoformat()
|
||||||
|
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
return mark_safe(f'<span title="{naturaltime(value)}">{text}</span>')
|
|
||||||
|
|
||||||
|
|
||||||
@register.filter()
|
@register.filter()
|
||||||
|
|
Loading…
Reference in New Issue