Skip to content

Commit e91c904

Browse files
committed
Add 'DELETE' to 'git-obs api' allowed methods
1 parent 7954b9d commit e91c904

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

osc/commands_git/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def init_arguments(self):
1515
self.add_argument(
1616
"-X",
1717
"--method",
18-
choices=["GET", "HEAD", "POST", "PATCH", "PUT"],
18+
choices=["GET", "HEAD", "POST", "PATCH", "PUT", "DELETE"],
1919
default="GET",
2020
)
2121
self.add_argument(

osc/gitea_api/connection.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def request(
127127
if self.login.token:
128128
headers["Authorization"] = f"token {self.login.token}"
129129

130-
if json_data:
130+
if json_data and isinstance(json_data, dict):
131131
json_data = dict(((key, value) for key, value in json_data.items() if value is not None))
132132

133133
body = json.dumps(json_data) if json_data else None

0 commit comments

Comments
 (0)