Better way to fix deletion of projection relationships

This commit is contained in:
blitzmann
2014-05-03 00:42:08 -04:00
parent fb9da5ec8d
commit 197a61253f
3 changed files with 22 additions and 3 deletions

View File

@@ -162,6 +162,8 @@ class Fit(object):
fit = eos.db.getFit(fitID)
sFlt = Fleet.getInstance()
sFlt.removeAssociatedFleetData(fit)
self.removeProjectedData(fitID)
eos.db.remove(fit)
def copyFit(self, fitID):
@@ -177,7 +179,15 @@ class Fit(object):
fit = eos.db.getFit(fitID)
fit.clear()
return fit
def removeProjectedData(self, fitID):
'''Removes projection relation from ships that have fitID as projection. See GitHub issue #90'''
fit = eos.db.getFit(fitID)
fits = eos.db.getProjectedFits(fitID)
for projectee in fits:
projectee.projectedFits.remove(fit)
def toggleFactorReload(self, fitID):
if fitID is None:
return None