From 2f7a3e0287123d21293674048a2585a2f56d96af Mon Sep 17 00:00:00 2001 From: MaruMaruOO Date: Tue, 17 Jul 2018 22:35:09 -0400 Subject: [PATCH] Have imported fits always use implants if present --- service/port.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/service/port.py b/service/port.py index a0dd0a89c..e659a5899 100644 --- a/service/port.py +++ b/service/port.py @@ -306,8 +306,11 @@ class Port(object): fit.character = sFit.character fit.damagePattern = sFit.pattern fit.targetResists = sFit.targetResists - useCharImplants = sFit.serviceFittingOptions["useCharacterImplantsByDefault"] - fit.implantLocation = ImplantLocation.CHARACTER if useCharImplants else ImplantLocation.FIT + if len(fit.implants) > 0: + fit.implantLocation = ImplantLocation.FIT + else: + useCharImplants = sFit.serviceFittingOptions["useCharacterImplantsByDefault"] + fit.implantLocation = ImplantLocation.CHARACTER if useCharImplants else ImplantLocation.FIT db.save(fit) # IDs.append(fit.ID) if iportuser: # Pulse @@ -339,8 +342,11 @@ class Port(object): fit.character = sFit.character fit.damagePattern = sFit.pattern fit.targetResists = sFit.targetResists - useCharImplants = sFit.serviceFittingOptions["useCharacterImplantsByDefault"] - fit.implantLocation = ImplantLocation.CHARACTER if useCharImplants else ImplantLocation.FIT + if len(fit.implants) > 0: + fit.implantLocation = ImplantLocation.FIT + else: + useCharImplants = sFit.serviceFittingOptions["useCharacterImplantsByDefault"] + fit.implantLocation = ImplantLocation.CHARACTER if useCharImplants else ImplantLocation.FIT db.save(fit) return fits