Make sure that items with forced group do not appear in their original group
This commit is contained in:
@@ -98,10 +98,10 @@ class Fit(object):
|
||||
|
||||
def groupHasFits(self, id):
|
||||
sMkt = Market.getInstance()
|
||||
grp = sMkt.getGroup(id)
|
||||
grp = sMkt.getGroup(id, eager=("items", "group"))
|
||||
items = sMkt.getItemsByGroup(grp)
|
||||
for item in items:
|
||||
if self.countFitsWithShip(item.id) > 0:
|
||||
if self.countFitsWithShip(item.ID) > 0:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -464,7 +464,7 @@ class Market():
|
||||
|
||||
def getItemsByGroup(self, group):
|
||||
"""Get items assigned to group"""
|
||||
items = group.items
|
||||
items = set(filter(lambda item: self.getPublicityByItem(item) and item.group == group, group.items))
|
||||
return items
|
||||
|
||||
def getItemsByMarketGroup(self, mg, vars=True):
|
||||
@@ -563,9 +563,8 @@ class Market():
|
||||
|
||||
def getShipList(self, grpid):
|
||||
"""Get ships for given group id"""
|
||||
grp = self.getGroup(grpid, eager = ("items", "items.marketGroup", "items.attributes"))
|
||||
ships = set(filter(lambda ship: self.getPublicityByItem(ship), grp.items))
|
||||
#ships.append((item.ID, item.name, item.race))
|
||||
grp = self.getGroup(grpid, eager = ("items", "items.group", "items.attributes"))
|
||||
ships = self.getItemsByGroup(grp)
|
||||
return ships
|
||||
|
||||
def getShipListDelayed(self, id, callback):
|
||||
|
||||
Reference in New Issue
Block a user