summaryrefslogtreecommitdiffstats
path: root/dashboard/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'dashboard/src/api')
-rw-r--r--dashboard/src/api/migrations/0002_remove_job_delta.py17
-rw-r--r--dashboard/src/api/models.py3
-rw-r--r--dashboard/src/api/views.py3
3 files changed, 20 insertions, 3 deletions
diff --git a/dashboard/src/api/migrations/0002_remove_job_delta.py b/dashboard/src/api/migrations/0002_remove_job_delta.py
new file mode 100644
index 0000000..157a40f
--- /dev/null
+++ b/dashboard/src/api/migrations/0002_remove_job_delta.py
@@ -0,0 +1,17 @@
+# Generated by Django 2.1 on 2018-10-17 15:32
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('api', '0001_initial'),
+ ]
+
+ operations = [
+ migrations.RemoveField(
+ model_name='job',
+ name='delta',
+ ),
+ ]
diff --git a/dashboard/src/api/models.py b/dashboard/src/api/models.py
index f1e9130..7448ac4 100644
--- a/dashboard/src/api/models.py
+++ b/dashboard/src/api/models.py
@@ -488,7 +488,8 @@ class NetworkConfig(TaskConfig):
return d
def clear_delta(self):
- pass
+ self.delta = json.dumps(self.to_dict())
+ self.save()
def add_interface(self, interface):
self.interfaces.add(interface)
diff --git a/dashboard/src/api/views.py b/dashboard/src/api/views.py
index cefd131..072354f 100644
--- a/dashboard/src/api/views.py
+++ b/dashboard/src/api/views.py
@@ -94,8 +94,7 @@ def specific_task(request, lab_name="", job_id="", task_id=""):
m['job'] = str(task.job)
m['message'] = task.message
d['meta'] = m
- response = json.dumps(d)
- return JsonResponse(response)
+ return JsonResponse(d, safe=False)
elif request.method == "GET":
return JsonResponse(get_task(task_id).config.get_delta())