Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
11fa3e08
Commit
11fa3e08
authored
Dec 15, 2017
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Bugfix] 修改ts_to_date bug
parent
2d0be8f9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
6 deletions
+1
-6
common_tags.py
apps/common/templatetags/common_tags.py
+1
-6
No files found.
apps/common/templatetags/common_tags.py
View file @
11fa3e08
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment