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 e0af3bb + c9e4b30 commit 40c37d0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 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
16 changes: 1 addition & 15 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from rest_framework.decorators import api_view
from django.contrib.auth.hashers import check_password
from rest_framework.permissions import AllowAny
from rest_framework.decorators import authentication_classes, permission_classes
from rest_framework.decorators import permission_classes, authentication_classes

from friends.models import Friend, FriendRequest
from .models import User
Expand Down 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 All @@ -136,8 +124,6 @@ def delete(self, request):


@api_view(["GET", "PATCH"])
@authentication_classes([])
@permission_classes([AllowAny])
def profile(request):
user = request.user

Expand Down
4 changes: 4 additions & 0 deletions friends/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from rest_framework.decorators import api_view

from rest_framework.response import Response
from rest_framework import status

from restaurants.models import UserRestaurantsList, Restaurant
from .serializers import (
UserSerializer,
Expand All @@ -9,8 +11,10 @@
RestaurantlistSerializer,
FriendRecommendSerializer,
)

from accounts.models import User
from .models import Friend, FriendRequest

from django.db.models import Count, Q
import random
from django.shortcuts import get_object_or_404
Expand Down

0 comments on commit 40c37d0

Please sign in to comment.