Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: organize utils #168

Merged
merged 2 commits into from
Jul 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def isList(obj: any) -> bool:
def islist(obj: any) -> bool:
"""
Check if object is a list
"""
Expand Down
6 changes: 3 additions & 3 deletions hinghwa-dict-backend/word/application/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
from utils.exception.types.bad_request import BadRequestExcption
from utils.exception.types.common import CommonException
from utils.exception.types.not_found import WordNotFoundExcption
from utils.types import isList
from website.utils.token import token_pass, token_user
from utils.TypeCheking import islist
from utils.TokenCheking import token_pass, token_user
from website.views import (
token_check,
sendNotification,
Expand Down Expand Up @@ -54,7 +54,7 @@ def post(self, request) -> JsonResponse:
body["content"].pop("word")
body.update(body["content"])
application_form = ApplicationForm(body)
if not (application_form.is_valid() and isList(body["mandarin"])):
if not (application_form.is_valid() and islist(body["mandarin"])):
raise BadRequestExcption()

# 构建申请
Expand Down