Using a shallow copy instead of ineficient json conversion

This commit is contained in:
Sergio Giménez Antón 2024-12-05 09:14:37 +01:00
parent 2813a095de
commit 9fa8cd57ba

View file

@ -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