修复了转换为webp后不删除源文件的bug
This commit is contained in:
@@ -430,6 +430,14 @@ def confirm(request):
|
||||
if not ok:
|
||||
return JsonResponse({"status": "error", "message": "写入ES失败"}, status=500)
|
||||
|
||||
try:
|
||||
if image_rel and final_image_rel != image_rel:
|
||||
orig_abs = os.path.join(settings.MEDIA_ROOT, image_rel)
|
||||
if os.path.isfile(orig_abs):
|
||||
os.remove(orig_abs)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return JsonResponse({"status": "success", "message": "数据录入成功", "data": edited})
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user