From f154a1712eeb044a287328074595e5ea49bc3de2 Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Wed, 15 Sep 2010 17:07:31 +0200 Subject: [PATCH] Don't do checks in the controller, rely on eos checking correctly --- controller/fit.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/controller/fit.py b/controller/fit.py index dc18eb705..f206e1fb3 100644 --- a/controller/fit.py +++ b/controller/fit.py @@ -75,18 +75,20 @@ class Fit(object): def appendModule(self, fitID, itemID): fit = eos.db.getFit(fitID) item = eos.db.getItem(itemID, eager=("attributes", "group.category")) - if item.category.name == "Module": - m = eos.types.Module(item) + m = eos.types.Module(item) + if m.fits(fit): + fit.modules.append(m) if m.isValidState(State.ACTIVE): m.state = State.ACTIVE - if m.fits(fit): - fit.modules.append(m) - - eos.db.commit() fit.clear() fit.calculateModifiedAttributes() - return True + fit.fill() + eos.db.commit() + + return True + else: + return False def removeModule(self, fitID, position): fit = eos.db.getFit(fitID)