Skip to content

Commit

Permalink
Merge pull request #36 from chaeunho1227/ceh-booth
Browse files Browse the repository at this point in the history
🚑 Fix : serializer에서 날짜 파라미터를 못 받아오는 문제 해결
  • Loading branch information
chaeunho1227 authored May 25, 2024
2 parents 237e597 + cecf176 commit 2060cc5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions booth/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ def trans_datetime_to_str(self, instance):
sorted_days = sorted(days_set, key=lambda x: days_map.index(x))
days_str = ', '.join(sorted_days)

date = self.context.get('date')

# date = self.context.get('date')
date_param = self.context.get('request').query_params.get('date')
# 운영시간 문자열로 변환
# 파라미터로 전달된 date 값으로 운영시간을 찾음
# date 파라미터를 받지 못했다면 오늘 날짜로 탐색
if date:
target_date = int(date)
if date_param:
target_date = int(date_param)
else:
target_date = int(datetime.today().day)

Expand Down

0 comments on commit 2060cc5

Please sign in to comment.