fix: flake8 lint

This commit is contained in:
AloneH 2020-10-22 09:24:16 +08:00
parent 1ebba5e295
commit 2688d0abb5
2 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,6 @@
import hashlib
import json
import os
import shutil
import tempfile
import zipfile
from wsgiref.util import FileWrapper
@ -676,10 +675,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")

View File

@ -33,4 +33,4 @@ class Difficulty(Choices):
HIGH = "High"
CONTEST_PASSWORD_SESSION_KEY = "contest_password"
CONTEST_PASSWORD_SESSION_KEY = "contest_password"