【发布时间】:2020-01-23 06:34:05
【问题描述】:
def post(self, request, *args, **kwargs):
post_data = request.data
task_id = post_data.get("task_id")
head = post_data.get("comment_head")
value = post_data.get("comment_description")
code = post_data.get("code")
task = entity_Task(task_id=task_id)
if task and head and value:
try:
if code and code == DELAY_FLAG_CODE:
entity_Comment.add_comment_flag_delay(
user=user, task_id=task_id, value=collection_feedback)
else:
comment = entity_Comment.add_comment_with_task_id(
user=request.user, task_id=task_id, head=head, value=value)
return JSONResponse({'code': 200, 'response': {"status": "Comment Saved"}})
except Exception as e:
xprint(e, traceback.format_exc())
return JSONResponse({'code': 500, 'response': {"error": str(e)}});
return JSONResponse({'code':200,'response':'Data Insufficient'})
在 vscode 编辑器中运行此代码后,我得到以下错误
IndentationError: unindent 不匹配任何外部缩进级别。
【问题讨论】:
-
欢迎来到 Stack Overflow!您的标题不是很有帮助,请考虑编辑它。可能包括错误而不是您的 IDE 的名称。看看how to ask。在深入研究之后才提出要求也是 SA 的良好语气的一部分。如果你用 SA 或 google 搜索你的错误,我敢打赌你会发现很多有用的结果,因为它是标准的 python 东西。即使是 eth 第一次命中也可能对您有所帮助:stackoverflow.com/questions/492387/…