avoid querying for runId = None

This commit is contained in:
Helmut Merz 2015-07-10 09:07:24 +02:00
parent b5994952c0
commit 129f4ba73d

View file

@ -270,6 +270,8 @@ class TrackingStorage(BTreeContainer):
def getUserTracks(self, taskId, runId, userName): def getUserTracks(self, taskId, runId, userName):
if not runId: if not runId:
runId = self.currentRuns.get(taskId) runId = self.currentRuns.get(taskId)
if runId is None:
return []
return self.query(taskId=taskId, runId=runId, userName=userName) return self.query(taskId=taskId, runId=runId, userName=userName)
def getLastUserTrack(self, taskId, runId, userName): def getLastUserTrack(self, taskId, runId, userName):
@ -283,6 +285,8 @@ class TrackingStorage(BTreeContainer):
result = None result = None
for idx in kw: for idx in kw:
value = kw[idx] value = kw[idx]
if idx == 'runId' and value is None:
continue
if idx in self.indexAttributes: if idx in self.indexAttributes:
if type(value) not in (list, tuple): if type(value) not in (list, tuple):
value = [value] value = [value]