Skip to content

Commit

Permalink
fix problems with int/str comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Sep 6, 2017
1 parent 44492e5 commit 4985638
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tripal/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def get_analyses(self, analysis_id=None, name=None, program=None, programversion
ans = self._request('chado/list', {'table': 'analysis'})

if analysis_id:
ans = [v for v in ans if v['analysis_id'] == analysis_id]
ans = [v for v in ans if v['analysis_id'] == str(analysis_id)]
if name:
ans = [v for v in ans if v['name'] == name]
if program:
Expand Down
2 changes: 1 addition & 1 deletion tripal/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def get_dbs(self, db_id=None, name=None):
dbs = self._request('chado/list', {'table': 'db'})

if db_id:
dbs = [v for v in dbs if v['db_id'] == db_id]
dbs = [v for v in dbs if v['db_id'] == str(db_id)]

return dbs

Expand Down
2 changes: 1 addition & 1 deletion tripal/organism/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_organisms(self, organism_id=None, genus=None, species=None, common=None,

orgs = self._request('chado/list', {'table': 'organism'})
if organism_id:
orgs = [v for v in orgs if v['organism_id'] == organism_id]
orgs = [v for v in orgs if v['organism_id'] == str(organism_id)]
if genus:
orgs = [v for v in orgs if v['genus'] == genus]
if species:
Expand Down

0 comments on commit 4985638

Please sign in to comment.