Skip to content

Commit

Permalink
fix flake8 standard problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Beichi-CHs committed Nov 18, 2021
1 parent 3754fa2 commit d4b3a42
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion account/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def get(self, request):
raw_data = f.read()
os.remove(file_path)
response = HttpResponse(raw_data)
response["Content-Disposition"] = f"attachment; filename=users.xlsx"
response["Content-Disposition"] = "attachment; filename=users.xlsx"
response["Content-Type"] = "application/xlsx"
return response

Expand Down
2 changes: 1 addition & 1 deletion account/views/oj.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ def post(self, request):
send_email_async.send(from_name=SysOptions.website_name_shortcut,
to_email=user.email,
to_name=user.username,
subject=f"Reset your password",
subject="Reset your password",
content=email_html)
return self.success("Succeeded")

Expand Down
2 changes: 1 addition & 1 deletion conf/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_edit_website_config(self):
"allow_register": True, "submission_list_show_all": False}
resp = self.client.post(url, data=data)
self.assertSuccess(resp)
self.assertEqual(SysOptions.website_footer, "<img src=\"#\" />")
self.assertEqual(SysOptions.website_footer, '<img src=\"#\" />')

def test_get_website_config(self):
# do not need to login
Expand Down
2 changes: 1 addition & 1 deletion problem/views/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def get(self, request):
delete_files.send_with_options(args=(path,), delay=300_000)
resp = FileResponse(open(path, "rb"))
resp["Content-Type"] = "application/zip"
resp["Content-Disposition"] = f"attachment;filename=problem-export.zip"
resp["Content-Disposition"] = "attachment;filename=problem-export.zip"
return resp


Expand Down
2 changes: 1 addition & 1 deletion run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
if os.system("flake8 --statistics ."):
exit()

ret = os.system("coverage run --include=\"$PWD/*\" manage.py test {module} --settings={setting}".format(module=test_module, setting=setting))
ret = os.system('coverage run --include=\"$PWD/*\" manage.py test {module} --settings={setting}'.format(module=test_module, setting=setting))

if not ret and is_coverage:
os.system("coverage html && open htmlcov/index.html")
2 changes: 1 addition & 1 deletion utils/management/commands/inituser.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def handle(self, *args, **options):
user = User.objects.get(username=username)
user.set_password(password)
user.save()
self.stdout.write(self.style.SUCCESS(f"Password is rested"))
self.stdout.write(self.style.SUCCESS("Password is rested"))
except User.DoesNotExist:
self.stdout.write(self.style.ERROR(f"User {username} doesnot exist, operation ignored"))
exit(1)
Expand Down

0 comments on commit d4b3a42

Please sign in to comment.