mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 23:02:26 +00:00
[markdown lint]add try to check slate data (#2997)
This commit is contained in:
@@ -31,7 +31,12 @@ class MarkdownLintView(APIView):
|
|||||||
if not slate:
|
if not slate:
|
||||||
error_msg = 'slate invalid.'
|
error_msg = 'slate invalid.'
|
||||||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||||
slate = json.loads(slate)
|
try:
|
||||||
|
slate = json.loads(slate)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(e)
|
||||||
|
error_msg = 'slate invalid.'
|
||||||
|
return api_error(status.HTTP_400_BAD_REQUEST, error_msg)
|
||||||
|
|
||||||
issue_list = []
|
issue_list = []
|
||||||
document_nodes = slate["document"]["nodes"]
|
document_nodes = slate["document"]["nodes"]
|
||||||
|
Reference in New Issue
Block a user