Skip to content

Commit

Permalink
Test: 오류 테스트트
Browse files Browse the repository at this point in the history
  • Loading branch information
joy-river committed Dec 29, 2024
1 parent 3e4ccf3 commit a0da32b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions KUA/course/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def retrieve(self, request, *args, **kwargs):

profile_image_url = f"http://3.37.163.236:8000/media/attachments/6789563.png"
try:
api_url = f"http://3.37.163.236:8000/student/image/?name={post.student.nickname}"
api_url = f"http://3.37.163.236:8000/student/image/?name={post.student.nickname}&tag='N'"
header = {
"Authorization": f"Token {request.META.get('HTTP_AUTHORIZATION')}"
}
Expand All @@ -356,7 +356,10 @@ def retrieve(self, request, *args, **kwargs):
if isinstance(image_data, list) and len(image_data) > 0:
first_item = image_data[0]
if "image" in first_item:
profile_image_url = f"http://3.37.163.236:8000{first_item['image']}"
profile_image_url = f"http://3.37.163.236:8000/{first_item['image']}"
else :
return Response({f"error": "Failed to get profile image.\n{image_data}"}, status=response.status_code)

except requests.exceptions.RequestException as e:
print(f"Request exception: {e}")

Expand Down

0 comments on commit a0da32b

Please sign in to comment.