Skip to content

Commit

Permalink
fix: 충돌 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
ybkang1108 committed Aug 13, 2024
2 parents 43b7a3f + 8557084 commit c9e4b30
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 44 deletions.
2 changes: 0 additions & 2 deletions accounts/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from .views import (
RegisterView,
LoginView,
LogoutView,
DeleteUserView,
profile,
)
Expand All @@ -11,7 +10,6 @@
urlpatterns = [
path("register/", RegisterView.as_view()),
path("login/", LoginView.as_view()),
path("logout/", LogoutView.as_view()),
path("delete-user/", DeleteUserView.as_view()),
path("refresh/", TokenRefreshView.as_view()), # jwt 토큰 재발급
path("profile/", profile, name="profile"),
Expand Down
12 changes: 0 additions & 12 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,6 @@ def post(self, request):
)


class LogoutView(APIView):
# 로그아웃
def delete(self, request):
# 쿠키에 저장된 토큰 삭제 => 로그아웃 처리
response = Response(
{"message": "Logout success"}, status=status.HTTP_202_ACCEPTED
)
response.delete_cookie("access")
response.delete_cookie("refresh")
return response


class DeleteUserView(APIView):
# 회원삭제
def delete(self, request):
Expand Down
2 changes: 0 additions & 2 deletions friends/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from django.shortcuts import render
from rest_framework.decorators import api_view

from rest_framework.response import Response
Expand All @@ -18,7 +17,6 @@

from django.db.models import Count, Q
import random

from django.shortcuts import get_object_or_404


Expand Down
17 changes: 0 additions & 17 deletions restaurants/views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
from rest_framework import status
Expand All @@ -10,18 +9,12 @@
RestaurantlistSerializer,
RestaurantDetailSerializer,
)

# from rest_framework.authentication import TokenAuthentication
from rest_framework.decorators import permission_classes
from rest_framework.permissions import IsAuthenticated
from django.views.decorators.csrf import csrf_exempt
import logging
from accounts.models import User # 임시 유저 지정을 위한 임포트, 추후 삭제
from django.db.models import Q, Subquery, OuterRef
from django.utils import timezone


@csrf_exempt
@api_view(["GET"])
def restaurant_list(request):
restaurants = Restaurant.objects.all()
Expand All @@ -30,8 +23,6 @@ def restaurant_list(request):


@api_view(["GET", "POST", "DELETE"])
# @authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
def search(request):
user = User.objects.get(id=21) # 임시 유저 지정, 추후 삭제
if request.method == "GET":
Expand Down Expand Up @@ -100,10 +91,7 @@ def search(request):
)


@csrf_exempt
@api_view(["GET"])
# @authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
def user_restaurant_list(request):
try:
user = User.objects.get(id=21) # 임시 유저 지정, 추후 삭제
Expand All @@ -119,10 +107,7 @@ def user_restaurant_list(request):
)


@csrf_exempt
@api_view(["POST", "DELETE"])
# @authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
def add_remove_restaurant(request, pk):
user = User.objects.get(id=21) # 임시 유저 지정, 추후 삭제
try:
Expand Down Expand Up @@ -159,8 +144,6 @@ def add_remove_restaurant(request, pk):


@api_view(["GET"])
# @authentication_classes([TokenAuthentication])
@permission_classes([IsAuthenticated])
def restaurant_detail(request, pk):
try:
restaurant = Restaurant.objects.prefetch_related("reviews").get(pk=pk)
Expand Down
11 changes: 0 additions & 11 deletions reviews/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,9 @@
ReplyListSerializer,
)

# from rest_framework.authentication import TokenAuthentication
# from rest_framework.permissions import IsAuthenticated


@api_view(["GET", "POST"])
# @authentication_classes([TokenAuthentication])
# @permission_classes([IsAuthenticated])
def review(request, pk):
"""
한줄평 더보기 기능 (GET)
한줄평 작성 기능 (POST)
"""
if request.method == "GET":
reviews = Review.objects.filter(restaurant_id=pk).order_by("-date")
serializer = ReviewListSerializer(reviews, many=True)
Expand Down Expand Up @@ -50,8 +41,6 @@ def review(request, pk):


@api_view(["GET", "POST"])
# @authentication_classes([TokenAuthentication])
# @permission_classes([IsAuthenticated])
def reply(request, pk):
if request.method == "GET":
replies = Reply.objects.filter(review_id=pk).order_by("date")
Expand Down

0 comments on commit c9e4b30

Please sign in to comment.