From 02a32f1c028c3ac6360348b61209734c24b8e6d2 Mon Sep 17 00:00:00 2001 From: myleosu <33693783+myleosu@users.noreply.github.com> Date: Sat, 16 Nov 2019 21:56:03 +0800 Subject: [PATCH] Update admin.py --- problem/views/admin.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/problem/views/admin.py b/problem/views/admin.py index 5b36859..1549f53 100644 --- a/problem/views/admin.py +++ b/problem/views/admin.py @@ -676,8 +676,8 @@ class FPSProblemImport(CSRFExemptAPIView): with tempfile.NamedTemporaryFile("wb") as tf: for chunk in file.chunks(4096): tf.file.write(chunk) - tf.file.flush() #确保file写入tf成功 - os.fsync(tf.file) #确保file写入tf成功 + tf.file.flush() + os.fsync(tf.file) problems = FPSParser(tf.name).parse() else: return self.error("Parse upload file error")