diff --git a/oml/item/models.py b/oml/item/models.py index 3037245..61732d1 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -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'])