checking item can faile with sqlalchemy.orm.exc.ObjectDeletedError
This commit is contained in:
parent
91fd3a61f5
commit
8766c7ef4e
1 changed files with 7 additions and 1 deletions
|
@ -733,7 +733,13 @@ class File(db.Model):
|
|||
return re.sub(r'^\.|\.$|:|/|\?|<|>|\\|\*|\||"', '_', string)
|
||||
prefs = settings.preferences
|
||||
prefix = os.sep.join(os.path.join(os.path.expanduser(prefs['libraryPath']), 'Books/').split('/'))
|
||||
if not self.item:
|
||||
not_item = False
|
||||
try:
|
||||
not_item = not self.item
|
||||
except:
|
||||
logger.debug('trying to move an item that was just deleted', exc_info=True)
|
||||
not_item = True
|
||||
if not_item:
|
||||
return
|
||||
j = self.item.json(keys=['title', 'author', 'publisher', 'date', 'extension'])
|
||||
|
||||
|
|
Loading…
Reference in a new issue