From 0070b1618b6a811d228c46c8d5c917457a3de878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20G=C3=B3mez=20Garc=C3=ADa?= Date: Mon, 26 Mar 2018 12:34:12 +0200 Subject: [PATCH] Fixed for getByAttr1 to return FIRST element in case of error --- server/src/uds/core/util/Storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/uds/core/util/Storage.py b/server/src/uds/core/util/Storage.py index a3be55db..2e170006 100644 --- a/server/src/uds/core/util/Storage.py +++ b/server/src/uds/core/util/Storage.py @@ -103,7 +103,7 @@ class Storage(object): def getPickleByAttr1(self, attr1): try: - return pickle.loads(encoders.decode(dbStorage.objects.get(owner=self._owner, attr1=attr1).data, 'base64')) # @UndefinedVariable + return pickle.loads(encoders.decode(dbStorage.objects.filter(owner=self._owner, attr1=attr1)[0].data, 'base64')) # @UndefinedVariable except Exception: return None