Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASTRON SDC
atdb-ldv
Commits
7255dcb8
Commit
7255dcb8
authored
2 years ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
bugfix error 500 when click service hold/resume button
parent
0c1d27c0
No related branches found
No related tags found
2 merge requests
!246
Master
,
!245
bugfix error 500 when click service hold/resume button
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
atdb/taskdatabase/services/algorithms.py
+2
-2
2 additions, 2 deletions
atdb/taskdatabase/services/algorithms.py
atdb/taskdatabase/urls.py
+2
-1
2 additions, 1 deletion
atdb/taskdatabase/urls.py
atdb/taskdatabase/views.py
+2
-2
2 additions, 2 deletions
atdb/taskdatabase/views.py
with
6 additions
and
5 deletions
atdb/taskdatabase/services/algorithms.py
+
2
−
2
View file @
7255dcb8
...
...
@@ -287,9 +287,9 @@ def convert_monitor_to_html(request, monitor_data):
# only provide the hold/resume buttons for superusers, otherwise just show the state
if
request
.
user
.
is_superuser
:
if
record
.
enabled
==
"
True
"
:
service_enabled
=
str
(
record
.
enabled
)
+
'
<a href=
"
service_hold_resume/
'
+
str
(
record
.
pk
)
+
'
/False
"'
+
'
class=
"
btn btn-warning btn-sm
"
role=
"
button
"
><i class=
"
fas fa-pause
"
></i> Hold</a>
'
service_enabled
=
str
(
record
.
enabled
)
+
'
<a href=
"
service_hold_resume/
'
+
record
.
name
+
'
/
'
+
record
.
hostname
+
'
/False
"'
+
'
class=
"
btn btn-warning btn-sm
"
role=
"
button
"
><i class=
"
fas fa-pause
"
></i> Hold</a>
'
else
:
service_enabled
=
str
(
record
.
enabled
)
+
'
<a href=
"
service_hold_resume/
'
+
str
(
record
.
pk
)
+
'
/True
"'
+
'
class=
"
btn btn-success btn-sm
"
role=
"
button
"
><i class=
"
fas fa-play
"
></i> Resume</a>
'
service_enabled
=
str
(
record
.
enabled
)
+
'
<a href=
"
service_hold_resume/
'
+
record
.
name
+
'
/
'
+
record
.
hostname
+
'
/True
"'
+
'
class=
"
btn btn-success btn-sm
"
role=
"
button
"
><i class=
"
fas fa-play
"
></i> Resume</a>
'
else
:
service_enabled
=
str
(
record
.
enabled
)
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/urls.py
+
2
−
1
View file @
7255dcb8
...
...
@@ -72,7 +72,8 @@ urlpatterns = [
path
(
'
monitor/<int:pk>/
'
,
views
.
MonitorDetailsViewAPI
.
as_view
(),
name
=
'
monitor-detail-view-api
'
),
path
(
'
latest_monitor/
'
,
views
.
LatestMonitorListViewAPI
.
as_view
(),
name
=
'
latest-monitor-detail-view-api
'
),
path
(
'
monitor/clear_inactive_services/
'
,
views
.
ClearInactiveServices
,
name
=
'
clear-inactive-services
'
),
path
(
'
monitoring/service_hold_resume/<int:pk>/<enabled>
'
,
views
.
ServiceHoldResume
,
name
=
'
service-hold-resume
'
),
# path('monitoring/service_hold_resume/<int:pk>/<enabled>', views.ServiceHoldResume, name='service-hold-resume'),
path
(
'
monitoring/service_hold_resume/<name>/<hostname>/<enabled>
'
,
views
.
ServiceHoldResume
,
name
=
'
service-hold-resume
'
),
# --- custom requests ---
# /atdb/get_size?status__in=defined,staged
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/views.py
+
2
−
2
View file @
7255dcb8
...
...
@@ -953,9 +953,9 @@ def HoldQuery(request, pk, hold_it, query_params):
return
redirect
(
'
/atdb/query/?
'
+
current_query_params
)
@login_required
def
ServiceHoldResume
(
request
,
pk
,
enabled
):
def
ServiceHoldResume
(
request
,
name
,
hostname
,
enabled
):
model
=
LatestMonitor
service
=
LatestMonitor
.
objects
.
get
(
pk
=
pk
)
service
=
LatestMonitor
.
objects
.
get
(
name
=
name
,
hostname
=
hostname
)
metadata
=
service
.
metadata
if
not
metadata
:
metadata
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment