From 6921c5032139a3844e2a60dabc80240dfb114440 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sun, 20 Jun 2021 14:30:47 +0200 Subject: set foreign key to null when deleting --- server/views.py | 1 + 1 file changed, 1 insertion(+) (limited to 'server') diff --git a/server/views.py b/server/views.py index 7ba0173..a9dfa74 100644 --- a/server/views.py +++ b/server/views.py @@ -799,6 +799,7 @@ def doclist(request): if i.medical_data: i.medical_data.delete() i.medical_data.save() + i.medical_data = None i.save() else: error = True -- cgit v1.2.1