Skip to content

Commit 0a38143

Browse files
author
Gauvain Pocentek
committed
ProjectFile.create(): don't modify the input data
Fixes #394
1 parent 6f36f70 commit 0a38143

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gitlab/v4/objects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,9 +1709,10 @@ def create(self, data, **kwargs):
17091709
"""
17101710

17111711
self._check_missing_create_attrs(data)
1712-
file_path = data.pop('file_path').replace('/', '%2F')
1712+
new_data = data.copy()
1713+
file_path = new_data.pop('file_path').replace('/', '%2F')
17131714
path = '%s/%s' % (self.path, file_path)
1714-
server_data = self.gitlab.http_post(path, post_data=data, **kwargs)
1715+
server_data = self.gitlab.http_post(path, post_data=new_data, **kwargs)
17151716
return self._obj_cls(self, server_data)
17161717

17171718
@exc.on_http_error(exc.GitlabUpdateError)

0 commit comments

Comments
 (0)