Merge branch 'master' into toggleProjectionFit

Conflicts:
	config.py
This commit is contained in:
blitzmann
2015-07-10 16:09:00 -04:00
12 changed files with 54 additions and 9 deletions

View File

@@ -17,7 +17,7 @@
# along with eos. If not, see <http://www.gnu.org/licenses/>.
#===============================================================================
from sqlalchemy.orm.attributes import flag_modified
#from sqlalchemy.orm.attributes import flag_modified
import eos.db
import eos.types
import logging
@@ -107,7 +107,10 @@ class HandledList(list):
def remove(self, thing):
# We must flag it as modified, otherwise it not be removed from the database
flag_modified(thing, "itemID")
# @todo: flag_modified isn't in os x skel. need to rebuild to include
#flag_modified(thing, "itemID")
if thing.isInvalid: # see GH issue #324
thing.itemID = 0
list.remove(self, thing)
class HandledModuleList(HandledList):
@@ -189,6 +192,7 @@ class HandledImplantBoosterList(HandledList):
oldObj = next((m for m in self if m.slot == thing.slot), None)
if oldObj:
logging.info("Slot %d occupied with %s, replacing with %s", thing.slot, oldObj.item.name, thing.item.name)
oldObj.itemID = 0 # hack to remove from DB. See GH issue #324
self.remove(oldObj)
HandledList.append(self, thing)