Skip to content

Commit

Permalink
Merge pull request #50 from dudtlstm/feature/filtering
Browse files Browse the repository at this point in the history
🩹 fix: λŒ“κΈ€ create μž μ‹œ 주석 처리
  • Loading branch information
dudtlstm authored May 27, 2024
2 parents f2b0a4d + a13d972 commit d18b628
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions booth/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,24 +145,24 @@ def get_queryset(self, *args, **kwargs):
)
return queryset

def create(self, request, *args, **kwargs):
#μ‚¬μš©μžκ°€ μž‘μ„±ν•œ λŒ“κΈ€ λ‚΄μš© 쀑 μš•μ„€ μžˆλŠ”μ§€ 필터링
content = request.data.get('content')
censored_content = censor_content(content)
# def create(self, request, *args, **kwargs):
# #μ‚¬μš©μžκ°€ μž‘μ„±ν•œ λŒ“κΈ€ λ‚΄μš© 쀑 μš•μ„€ μžˆλŠ”μ§€ 필터링
# content = request.data.get('content')
# censored_content = censor_content(content)

password = request.data.get('password')
hashed_password = make_password(password)
# password = request.data.get('password')
# hashed_password = make_password(password)

data = request.data.copy()
data['content'] = censored_content
data['password'] = hashed_password
# data = request.data.copy()
# data['content'] = censored_content
# data['password'] = hashed_password

serializer = self.get_serializer(data=data)
serializer.is_valid(raise_exception=True)
self.perform_create(serializer)
# serializer = self.get_serializer(data=data)
# serializer.is_valid(raise_exception=True)
# self.perform_create(serializer)

headers = self.get_success_headers(serializer.data)
return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)
# headers = self.get_success_headers(serializer.data)
# return Response(serializer.data, status=status.HTTP_201_CREATED, headers=headers)

def destroy(self, request, *args, **kwargs):
instance = self.get_object()
Expand Down

0 comments on commit d18b628

Please sign in to comment.