diff options
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/migrations/0002_remove_job_delta.py | 17 | ||||
-rw-r--r-- | src/api/models.py | 3 | ||||
-rw-r--r-- | src/api/views.py | 3 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/api/migrations/0002_remove_job_delta.py b/src/api/migrations/0002_remove_job_delta.py new file mode 100644 index 0000000..157a40f --- /dev/null +++ b/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/src/api/models.py b/src/api/models.py index f1e9130..7448ac4 100644 --- a/src/api/models.py +++ b/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/src/api/views.py b/src/api/views.py index cefd131..072354f 100644 --- a/src/api/views.py +++ b/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()) |