From 9fa8cd57ba974978f6463bf0c728e11003c14210 Mon Sep 17 00:00:00 2001 From: sergiogimenez Date: Thu, 5 Dec 2024 09:14:37 +0100 Subject: [PATCH] Using a shallow copy instead of ineficient json conversion --- device/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/device/models.py b/device/models.py index a9799de..3fcb9e0 100644 --- a/device/models.py +++ b/device/models.py @@ -311,7 +311,7 @@ class Device: if is_user_authenticated: return self.components - public_components = json.loads(json.dumps(self.components)) + public_components = [component.copy() for component in self.components] self.remove_sensitive_data_from(public_components) return public_components