Commit 11fa3e08 authored by ibuler's avatar ibuler

[Bugfix] 修改ts_to_date bug

parent 2d0be8f9
...@@ -57,7 +57,7 @@ def int_to_str(value): ...@@ -57,7 +57,7 @@ def int_to_str(value):
def ts_to_date(ts): def ts_to_date(ts):
try: try:
ts = float(ts) ts = float(ts)
except ValueError: except (TypeError, ValueError):
ts = 0 ts = 0
dt = timezone.datetime.fromtimestamp(ts).\ dt = timezone.datetime.fromtimestamp(ts).\
replace(tzinfo=timezone.get_current_timezone()) replace(tzinfo=timezone.get_current_timezone())
...@@ -67,8 +67,3 @@ def ts_to_date(ts): ...@@ -67,8 +67,3 @@ def ts_to_date(ts):
@register.filter @register.filter
def to_html(s): def to_html(s):
return escape(s).replace('\n', '<br />') return escape(s).replace('\n', '<br />')
# @register.filter
# def proxy_log_commands(log_id):
# return 1
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