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:
@@ -15,7 +15,7 @@ class ApiCommand(osc.commandline_git.GitObsCommand):
|
|||||||
self.add_argument(
|
self.add_argument(
|
||||||
"-X",
|
"-X",
|
||||||
"--method",
|
"--method",
|
||||||
choices=["GET", "HEAD", "POST", "PATCH", "PUT"],
|
choices=["GET", "HEAD", "POST", "PATCH", "PUT", "DELETE"],
|
||||||
default="GET",
|
default="GET",
|
||||||
)
|
)
|
||||||
self.add_argument(
|
self.add_argument(
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ class Connection:
|
|||||||
if self.login.token:
|
if self.login.token:
|
||||||
headers["Authorization"] = f"token {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))
|
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
|
body = json.dumps(json_data) if json_data else None
|
||||||
|
|||||||
Reference in New Issue
Block a user