[damned-lies] Fixed #132 - Ensured directory exists in commit_po method



commit b61f4f9cd5e8a5a06f06cc5295748d79665e5e3c
Author: Claude Paroz <claude 2xlibre net>
Date:   Sat Mar 2 14:51:48 2019 +0100

    Fixed #132 - Ensured directory exists in commit_po method

 stats/models.py | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/stats/models.py b/stats/models.py
index 3a1a17b4..f0b01339 100644
--- a/stats/models.py
+++ b/stats/models.py
@@ -553,6 +553,8 @@ class Branch(models.Model):
         with ModuleLock(self.module):
             self.update_repo()
             dest_full_path, existing, linguas_path = domain.commit_info(self, language)
+            if not dest_full_path.parent.exists():
+                dest_full_path.parent.mkdir(parents=True)
             # Copy file in repo
             shutil.copyfile(str(po_file), str(dest_full_path))
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]