Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca37d23

Browse files
authored
Merge pull request#1038 from nejch/fix/allow-empty-create-data
Fix: do not require empty data dict for create()
2 parentse5afb55 +99d959f commitca37d23

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

‎docs/gl_objects/access_requests.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ List access requests from projects and groups::
3737

3838
Create an access request::
3939

40-
p_ar = project.accessrequests.create({})
41-
g_ar = group.accessrequests.create({})
40+
p_ar = project.accessrequests.create()
41+
g_ar = group.accessrequests.create()
4242

4343
Approve an access request::
4444

‎docs/gl_objects/projects.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Delete a project::
103103

104104
Fork a project::
105105

106-
fork = project.forks.create({})
106+
fork = project.forks.create()
107107

108108
# fork to a specific namespace
109109
fork = project.forks.create({'namespace': 'myteam'})
@@ -255,7 +255,7 @@ generated by GitLab you need to:
255255

256256
# Create the export
257257
p = gl.projects.get(my_project)
258-
export = p.exports.create({})
258+
export = p.exports.create()
259259

260260
# Wait for the 'finished' status
261261
export.refresh()

‎gitlab/mixins.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def get_create_attrs(self):
170170
returngetattr(self,"_create_attrs", (tuple(),tuple()))
171171

172172
@exc.on_http_error(exc.GitlabCreateError)
173-
defcreate(self,data,**kwargs):
173+
defcreate(self,data=None,**kwargs):
174174
"""Create a new object.
175175
176176
Args:
@@ -186,6 +186,9 @@ def create(self, data, **kwargs):
186186
GitlabAuthenticationError: If authentication is not correct
187187
GitlabCreateError: If the server cannot perform the request
188188
"""
189+
ifdataisNone:
190+
data= {}
191+
189192
self._check_missing_create_attrs(data)
190193
files= {}
191194

‎tools/python_test_v4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@
949949
[current_project.delete()forcurrent_projectinprojects]
950950

951951
# project import/export
952-
ex=admin_project.exports.create({})
952+
ex=admin_project.exports.create()
953953
ex.refresh()
954954
count=0
955955
whileex.export_status!="finished":

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp