diff --git a/service/fit.py b/service/fit.py index bc7e7bf563..2bc071bbc7 100644 --- a/service/fit.py +++ b/service/fit.py @@ -214,7 +214,11 @@ def switchFit(self, fitID): eos.db.commit() self.recalc(fit, withBoosters=True) - def getFit(self, fitID): + def getFit(self, fitID, projected = False): + ''' Gets fit from database, and populates fleet data. + + Projected is a recursion flag that is set to reduce recursions into projected fits + ''' if fitID is None: return None fit = eos.db.getFit(fitID) @@ -227,8 +231,13 @@ def getFit(self, fitID): fit.fleet = None else: fit.fleet = f - self.recalc(fit, withBoosters=True) - fit.fill() + + if not projected: + for fitP in fit.projectedFits: + self.getFit(fitP.ID, projected = True) + self.recalc(fit, withBoosters=True) + fit.fill() + eos.db.commit() fit.inited = True return fit