From f811d74b5ecbecc1d3d33e2027ec94e047767105 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 11 May 2017 02:11:48 +0200 Subject: [PATCH] permissions --- oml/item/models.py | 1 + oml/item/scan.py | 1 + 2 files changed, 2 insertions(+) diff --git a/oml/item/models.py b/oml/item/models.py index 5fa1a75..56b14ad 100644 --- a/oml/item/models.py +++ b/oml/item/models.py @@ -788,6 +788,7 @@ class File(db.Model): path = os.path.join(prefix, new_path) ox.makedirs(os.path.dirname(path)) try: + os.chmod(current_path, stat.S_IWRITE) shutil.move(current_path, path) except: logger.debug('failed to move %s to %s', current_path, path, exc_info=True) diff --git a/oml/item/scan.py b/oml/item/scan.py index c5093f6..7cd29c5 100644 --- a/oml/item/scan.py +++ b/oml/item/scan.py @@ -196,6 +196,7 @@ def run_import(options=None): listitems = [] assert isinstance(prefix, str) books = [] + def activity(count): if count % 100 == 0: state.activity = {