fix is_json() check for flask 3.0

This commit is contained in:
James Ravenscroft 2024-12-02 13:50:43 +00:00
parent bc7f8c822d
commit d1e0106373
1 changed files with 3 additions and 1 deletions

View File

@ -465,9 +465,11 @@ def get_api_client() -> forgejo.RepositoryApi:
@core_bp.route("/", methods=["POST"])
@authed_endpoint
def req():
if request.get_json():
print("hello")
if request.is_json:
docstr, frontmatter, file_path = process_json_post()
else:
print(request.form)
docstr, frontmatter, file_path = process_multipart_post()
frontmatter_str = yaml.dump(frontmatter)