Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
abretaud committed Oct 28, 2019
1 parent 685ec0a commit c70b459
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apollo/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ def GuessOrg(args, wa):
else:
raise Exception("Organism Common Name not provided")
elif args.org_id:
return [wa.organisms.findOrganismById(args.org_id).get('commonName', None)]
all_orgs = wa.organisms.get_organisms()
if 'error' in all_orgs:
raise Exception("Error while getting the list of organisms: %s" % all_orgs)
orgs = [org['commonName'] for org in all_orgs if str(args.org_id) == str(org['id'])]
return orgs
else:
raise Exception("Organism Common Name not provided")

Expand Down

0 comments on commit c70b459

Please sign in to comment.