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

Fix: do not require empty data dict for create()#1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intopython-gitlab:masterfromnejch:fix/allow-empty-create-data
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionsdocs/gl_objects/access_requests.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,8 @@ List access requests from projects and groups::

Create an access request::

p_ar = project.accessrequests.create({})
g_ar = group.accessrequests.create({})
p_ar = project.accessrequests.create()
g_ar = group.accessrequests.create()

Approve an access request::

Expand Down
4 changes: 2 additions & 2 deletionsdocs/gl_objects/projects.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,7 +103,7 @@ Delete a project::

Fork a project::

fork = project.forks.create({})
fork = project.forks.create()

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

# Create the export
p = gl.projects.get(my_project)
export = p.exports.create({})
export = p.exports.create()

# Wait for the 'finished' status
export.refresh()
Expand Down
5 changes: 4 additions & 1 deletiongitlab/mixins.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -170,7 +170,7 @@ def get_create_attrs(self):
return getattr(self, "_create_attrs", (tuple(), tuple()))

@exc.on_http_error(exc.GitlabCreateError)
def create(self, data, **kwargs):
def create(self, data=None, **kwargs):
"""Create a new object.

Args:
Expand All@@ -186,6 +186,9 @@ def create(self, data, **kwargs):
GitlabAuthenticationError: If authentication is not correct
GitlabCreateError: If the server cannot perform the request
"""
if data is None:
data = {}

self._check_missing_create_attrs(data)
files = {}

Expand Down
2 changes: 1 addition & 1 deletiontools/python_test_v4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -949,7 +949,7 @@
[current_project.delete() for current_project in projects]

# project import/export
ex = admin_project.exports.create({})
ex = admin_project.exports.create()
ex.refresh()
count = 0
while ex.export_status != "finished":
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp