Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
5f6da88d
Commit
5f6da88d
authored
May 18, 2020
by
Sean Arnold
Committed by
Stan Hu
May 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix time parse fallback
- Time.zone.parse wasn't always throwing an error
parent
255e6054
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
ee/app/controllers/projects/security/network_policies_controller.rb
...trollers/projects/security/network_policies_controller.rb
+8
-2
No files found.
ee/app/controllers/projects/security/network_policies_controller.rb
View file @
5f6da88d
...
...
@@ -17,8 +17,8 @@ module Projects
result
=
adapter
.
query
(
:packet_flow
,
environment
.
deployment_namespace
,
params
[
:interval
]
||
"minute"
,
(
Time
.
zone
.
parse
(
params
[
:from
])
rescue
1
.
hour
.
ago
).
to_s
,
(
Time
.
zone
.
parse
(
params
[
:to
])
rescue
Time
.
current
).
to_s
parse_time
(
params
[
:from
],
1
.
hour
.
ago
).
to_s
,
parse_time
(
params
[
:to
],
Time
.
current
).
to_s
)
respond_to
do
|
format
|
...
...
@@ -35,6 +35,12 @@ module Projects
private
def
parse_time
(
params
,
fallback
)
Time
.
zone
.
parse
(
params
)
||
fallback
rescue
fallback
end
def
environment
@environment
||=
project
.
environments
.
find
(
params
[
:environment_id
])
end
...
...
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