Fix issue in which prices are removed all the time (forgot to add the check for deleted to the condition >.<)

This commit is contained in:
blitzmann
2017-04-21 00:40:45 -04:00
parent 53cab4b1ab
commit e971b7927e

View File

@@ -444,8 +444,11 @@ class Item(EqBase):
def price(self):
# todo: use `from sqlalchemy import inspect` instead (need to verify it works in old and new OS X builds)
if self.__price is not None and getattr(self.__price, '_sa_instance_state', None):
pyfalog.debug("Price data for {} was deleted, resetting object".format(self.ID))
if self.__price is not None and getattr(self.__price, '_sa_instance_state', None) and self.__price._sa_instance_state.deleted:
pyfalog.debug("Price data for {} was deleted (probably from a cache reset), resetting object".format(self.ID))
self.__price = None
if self.__price is None: