fix is_json() check for flask 3.0
This commit is contained in:
parent
bc7f8c822d
commit
d1e0106373
|
@ -465,9 +465,11 @@ def get_api_client() -> forgejo.RepositoryApi:
|
||||||
@core_bp.route("/", methods=["POST"])
|
@core_bp.route("/", methods=["POST"])
|
||||||
@authed_endpoint
|
@authed_endpoint
|
||||||
def req():
|
def req():
|
||||||
if request.get_json():
|
print("hello")
|
||||||
|
if request.is_json:
|
||||||
docstr, frontmatter, file_path = process_json_post()
|
docstr, frontmatter, file_path = process_json_post()
|
||||||
else:
|
else:
|
||||||
|
print(request.form)
|
||||||
docstr, frontmatter, file_path = process_multipart_post()
|
docstr, frontmatter, file_path = process_multipart_post()
|
||||||
|
|
||||||
frontmatter_str = yaml.dump(frontmatter)
|
frontmatter_str = yaml.dump(frontmatter)
|
||||||
|
|
Loading…
Reference in New Issue