大幅优化数据库查询, 升级django至1.11 LTS, 升级python至3.6.2

This commit is contained in:
zema1 committed 2017-08-29 19:35:22 +08:00
1 parent 539b45148b
commit 1e4ede6d1a
13 files changed
+57 -33

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ class UserProfileAPI(APIView):
user = request.user
except User.DoesNotExist:
return self.error("User does not exist")
profile = UserProfile.objects.get(user=user)
profile = UserProfile.objects.select_related("user").get(user=user)
return self.success(UserProfileSerializer(profile).data)
@validate_serializer(EditUserProfileSerializer)