mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-28 08:02:11 +00:00
fix(style): code style
This commit is contained in:
parent
515f422a2d
commit
0566b2856e
@ -1,7 +1,7 @@
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import shutil
|
||||
# import shutil
|
||||
import tempfile
|
||||
import zipfile
|
||||
from wsgiref.util import FileWrapper
|
||||
@ -676,10 +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")
|
||||
|
@ -10,7 +10,7 @@ from contest.models import ContestRuleType
|
||||
class ProblemTagAPI(APIView):
|
||||
def get(self, request):
|
||||
qs = ProblemTag.objects
|
||||
keyword = request.GET.get('keyword')
|
||||
keyword = request.GET.get("keyword")
|
||||
if keyword:
|
||||
qs = ProblemTag.objects.filter(name__icontains=keyword)
|
||||
tags = qs.annotate(problem_count=Count("problem")).filter(problem_count__gt=0)
|
||||
|
@ -33,4 +33,4 @@ class Difficulty(Choices):
|
||||
HIGH = "High"
|
||||
|
||||
|
||||
CONTEST_PASSWORD_SESSION_KEY = "contest_password"
|
||||
CONTEST_PASSWORD_SESSION_KEY = "contest_password"
|
||||
|
Loading…
Reference in New Issue
Block a user