Skip to content

Commit

Permalink
Fix/51/game get (#68)
Browse files Browse the repository at this point in the history
* #51 fix : modify item show state of item location update api

* #51 fix : modify the logic of checking item is owned
  • Loading branch information
0321minji authored Aug 13, 2024
1 parent a63d07d commit 88b06bd
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lands/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,13 @@ def put(self, request):

# 기존 위치 정보를 가져오거나 생성합니다.
location, created = Location.objects.get_or_create(item=item,land=request.user.lands)

if not location.show:
location.show=True
# 위치 정보를 업데이트합니다.
location.x = location_data['x']
location.y = location_data['y']
location.z = location_data['z']
location.save()

if created:
item.show=True
item.save()

if land_back_id:
land = get_object_or_404(Land,user=request.user)
Expand Down Expand Up @@ -573,7 +570,7 @@ def put(self,request):
for item_id in item_ids:
item = get_object_or_404(Item,pk=item_id)
user_emails = item.users.values_list('email', flat=True)
if request.user not in user_emails:
if request.user.email not in user_emails:
item.users.add(request.user)
item.save() # 변경 사항 저장
Location.objects.create(
Expand Down

0 comments on commit 88b06bd

Please sign in to comment.