1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-12-04 09:31:11 +01:00

Add 'DELETE' to 'git-obs api' allowed methods

This commit is contained in:
2025-10-15 11:15:40 +02:00
parent 7954b9d11a
commit e91c904284
2 changed files with 2 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ class ApiCommand(osc.commandline_git.GitObsCommand):
self.add_argument(
"-X",
"--method",
choices=["GET", "HEAD", "POST", "PATCH", "PUT"],
choices=["GET", "HEAD", "POST", "PATCH", "PUT", "DELETE"],
default="GET",
)
self.add_argument(

View File

@@ -127,7 +127,7 @@ class Connection:
if self.login.token:
headers["Authorization"] = f"token {self.login.token}"
if json_data:
if json_data and isinstance(json_data, dict):
json_data = dict(((key, value) for key, value in json_data.items() if value is not None))
body = json.dumps(json_data) if json_data else None