Skip to content

Commit

Permalink
Merge branch 'main' into 265-feat-친구-정보-모달-api-이식
Browse files Browse the repository at this point in the history
  • Loading branch information
bluedog129 authored Feb 26, 2024
2 parents 5253d59 + 8ad60a8 commit d9123cb
Show file tree
Hide file tree
Showing 24 changed files with 864 additions and 257 deletions.
2 changes: 1 addition & 1 deletion backend/friends/consumers.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async def disconnect(self, close_code):
await set_user_online(self.user.id, online=False)
logger.info(f"Websocket connection closed for user {self.user.id}")
if hasattr(self, 'send_update_task') and self.send_update_task:
self.send_update_task.cancle()
self.send_update_task.cancel()
try:
await self.send_update_task
except asyncio.CancelledError:
Expand Down
14 changes: 7 additions & 7 deletions backend/friends/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def get(self, request):
response_data = {'friends': friend_list}
return Response(response_data, status=status.HTTP_200_OK)
except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except User.DoesNotExist:
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
except Exception as e:
Expand Down Expand Up @@ -75,7 +75,7 @@ def post(self, request):
Friend.objects.create(user_id=current_user, friend_id=requested_friend, status=0)
return Response({'message': 'Friend request sent'}, status=status.HTTP_200_OK)
except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except User.DoesNotExist:
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
except Exception as e:
Expand Down Expand Up @@ -108,7 +108,7 @@ def delete(self, request):
Friend.objects.filter(user_id=requested_friend, friend_id=current_user, status=1).delete()
return Response({'message': 'Friend deleted'}, status=status.HTTP_200_OK)
except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except User.DoesNotExist:
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
except Exception as e:
Expand Down Expand Up @@ -146,7 +146,7 @@ def post(self, request):
return Response({'message': 'Friend request Accepted'}, status=status.HTTP_200_OK)

except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except User.DoesNotExist:
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
except Exception as e:
Expand Down Expand Up @@ -181,7 +181,7 @@ def post(self, request):
return Response({'message': 'Friend request rejected'}, status=status.HTTP_200_OK)

except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except User.DoesNotExist:
return Response({'error': 'User not found'}, status=status.HTTP_404_NOT_FOUND)
except Exception as e:
Expand All @@ -202,7 +202,7 @@ def get(self, request):
return Response({'searchedUserList': users_data}, status=status.HTTP_200_OK)

except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except Exception as e:
return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)

Expand All @@ -223,6 +223,6 @@ def get(self, request):
response_data = {'friendRequestList': friend_request_list}
return Response(response_data, status=status.HTTP_200_OK)
except AuthenticationException as e:
return Response({'error': e.messages}, status=status.HTTP_401_UNAUTHORIZED)
return Response({'error': e.message}, status=status.HTTP_401_UNAUTHORIZED)
except Exception as e:
return Response({'error': str(e)}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
Loading

0 comments on commit d9123cb

Please sign in to comment.