Merge pull request #283 from myleosu/myleosu-patch-1
fix FPSProblemImport bug
This commit is contained in:
@@ -676,6 +676,10 @@ class FPSProblemImport(CSRFExemptAPIView):
|
|||||||
with tempfile.NamedTemporaryFile("wb") as tf:
|
with tempfile.NamedTemporaryFile("wb") as tf:
|
||||||
for chunk in file.chunks(4096):
|
for chunk in file.chunks(4096):
|
||||||
tf.file.write(chunk)
|
tf.file.write(chunk)
|
||||||
|
|
||||||
|
tf.file.flush()
|
||||||
|
os.fsync(tf.file)
|
||||||
|
|
||||||
problems = FPSParser(tf.name).parse()
|
problems = FPSParser(tf.name).parse()
|
||||||
else:
|
else:
|
||||||
return self.error("Parse upload file error")
|
return self.error("Parse upload file error")
|
||||||
|
|||||||
Reference in New Issue
Block a user