mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2025-09-26 23:09:21 +08:00
Merge pull request #283 from myleosu/myleosu-patch-1
fix FPSProblemImport bug
This commit is contained in:
commit
d5ccadcdf3
@ -676,6 +676,10 @@ class FPSProblemImport(CSRFExemptAPIView):
|
||||
with tempfile.NamedTemporaryFile("wb") as tf:
|
||||
for chunk in file.chunks(4096):
|
||||
tf.file.write(chunk)
|
||||
|
||||
tf.file.flush()
|
||||
os.fsync(tf.file)
|
||||
|
||||
problems = FPSParser(tf.name).parse()
|
||||
else:
|
||||
return self.error("Parse upload file error")
|
||||
|
Loading…
Reference in New Issue
Block a user