diff --git a/vcp_management/models/vcp_repository_branch.py b/vcp_management/models/vcp_repository_branch.py index 9c338d3..209b088 100644 --- a/vcp_management/models/vcp_repository_branch.py +++ b/vcp_management/models/vcp_repository_branch.py @@ -78,7 +78,16 @@ def process_rules(self): def _download_code(self): self.ensure_one() local_path = self.local_path - os.makedirs(local_path, exist_ok=True) + try: + os.makedirs(local_path, exist_ok=True) + except PermissionError as err: + raise ValidationError( + _( + "Unable to create a folder in '%(local_path)s'.", + local_path=local_path, + ) + ) from err + try: repo = git.Repo(local_path) for remote in repo.remotes: