M gitsrht/blueprints/api/info.py => gitsrht/blueprints/api/info.py +2 -0
@@ 40,6 40,8 @@ def repos_POST():
resp = current_app.repo_api.create_repo(valid, user)
if not valid.ok:
return valid.response
+ # Convert visibility back to lowercase
+ resp["visibility"] = resp["visibility"].lower()
return resp, 201
@info.route("/api/repos/<reponame>", defaults={"username": None})
M gitsrht/repos.py => gitsrht/repos.py +5 -0
@@ 91,6 91,11 @@ class GitRepoApi():
if not valid.ok:
return None
+ # Convert the visibility to uppercase. This is needed for the REST API
+ # TODO: Remove this when the REST API is phased out
+ if visibility is not None:
+ visibility = visibility.upper()
+
resp = exec_gql("git.sr.ht", """
mutation CreateRepository(
$name: String!,