Skip to content

Commit

Permalink
Bug: InvalidRequestError에 대한 범위 설정 수정
Browse files Browse the repository at this point in the history
Requried Field의 범위를 잡을 때 not을 안 붙여 정상적인 요청을 에러로 처리하던 것 수정
  • Loading branch information
fnzksxl committed Jul 23, 2024
1 parent d45147f commit 9e67173
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions wtnt/team/team/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TeamView(APIView):

def post(self, request, *args, **kwargs):
required_field = ["title", "genre", "explain", "subCategory", "memberCount"]
if 5 <= len(request.data) <= 7:
if not (5 <= len(request.data) <= 7):
raise exception.InvalidRequestError()
for field in required_field:
if field not in request.data:
Expand All @@ -41,7 +41,7 @@ def get(self, request, *args, **kwargs):

def put(self, request, *args, **kwargs):
required_field = ["title", "genre", "explain", "subCategory", "memberCount"]
if 5 <= len(request.data) <= 7:
if not (5 <= len(request.data) <= 7):
raise exception.InvalidRequestError()
for field in required_field:
if field not in request.data:
Expand Down
2 changes: 1 addition & 1 deletion wtnt/user/profile/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get(self, request, *args, **kwargs):

def patch(self, request, *args, **kwargs):
required_field = ["explain", "position"]
if 2 <= len(request.data) <= 3:
if not (2 <= len(request.data) <= 3):
raise exception.InvalidRequestError()
for field in required_field:
if field not in request.data:
Expand Down

0 comments on commit 9e67173

Please sign in to comment.