Skip to content

Commit

Permalink
Merge pull request #1588 from 0-complexity/disk_list
Browse files Browse the repository at this point in the history
fix list disks filtering
  • Loading branch information
alichaddad authored Jul 4, 2018
2 parents 95b5b75 + 8075cc5 commit a26ce1c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ def list(self, accountId, type, **kwargs):
:return: list with every element containing details of a disk as a dict
"""
query = {'accountId': {'$in': [accountId, None]}, 'status': {'$ne': 'DESTROYED'}}
if type:
query['type'] = type
disks = self.models.disk.search(query)[1:]
diskids = [disk['id'] for disk in disks]
query = {'disks': {'$in': diskids}}
Expand Down

0 comments on commit a26ce1c

Please sign in to comment.