Skip to content

Commit

Permalink
ProjectFile: handle / in path for delete() and save()
Browse files Browse the repository at this point in the history
Fixes #326
  • Loading branch information
Gauvain Pocentek committed Sep 29, 2017
1 parent 69f1045 commit 05656bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gitlab/v4/objects.py
Expand Up @@ -1360,6 +1360,7 @@ def save(self, branch, commit_message, **kwargs):
"""
self.branch = branch
self.commit_message = commit_message
self.file_path = self.file_path.replace('/', '%2F')
super(ProjectFile, self).save(**kwargs)

def delete(self, branch, commit_message, **kwargs):
Expand All @@ -1374,7 +1375,8 @@ def delete(self, branch, commit_message, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabDeleteError: If the server cannot perform the request
"""
self.manager.delete(self.get_id(), branch, commit_message, **kwargs)
file_path = self.get_id().replace('/', '%2F')
self.manager.delete(file_path, branch, commit_message, **kwargs)


class ProjectFileManager(GetMixin, CreateMixin, UpdateMixin, DeleteMixin,
Expand Down

0 comments on commit 05656bb

Please sign in to comment.