1
0
mirror of https://github.com/dkmstr/openuds.git synced 2024-12-31 17:17:53 +03:00

Fixed for getByAttr1 to return FIRST element in case of error

This commit is contained in:
Adolfo Gómez García 2018-03-26 12:34:12 +02:00
parent 3b04e2a180
commit 0070b1618b

View File

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