Skip to content

Fix: 존재하지 않는 기능의 status 조회시 서버 오류가 발생하지 않게 수정 #35

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

Merged
merged 2 commits into from
Feb 25, 2023
Merged
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
3 changes: 2 additions & 1 deletion status/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import datetime

from django.shortcuts import get_object_or_404
from pytz import timezone
from rest_framework.response import Response
from rest_framework.views import APIView
Expand All @@ -9,7 +10,7 @@

class StatusView(APIView):
def get(self, request, name: str):
status = Status.objects.get(name=name)
status = get_object_or_404(Status, name=name)
now = datetime.datetime.now(tz=timezone("Asia/Seoul"))

flag = None
Expand Down