remove param current_id and returns current_id/photos for lensman_photo_upload_api

Brightcells 8 years ago
parent
commit
49f3749ebd
1 changed files with 11 additions and 11 deletions
  1. 11 11
      group/lensman_views.py

+ 11 - 11
group/lensman_views.py

@@ -134,7 +134,7 @@ def lensman_photo_upload_api(request):
134 134
 
135 135
     photo = request.FILES.get('photo', '')
136 136
 
137
-    current_id = int(request.POST.get('current_id', -1))
137
+    # current_id = int(request.POST.get('current_id', -1))
138 138
 
139 139
     # 用户校验
140 140
     try:
@@ -244,17 +244,17 @@ def lensman_photo_upload_api(request):
244 244
         r.set(GROUP_LAST_PHOTO_PK % group_id, group_photo.pk)
245 245
 
246 246
     # 获取从 current_id 到 now 的群组照片列表
247
-    group_photos = GroupPhotoInfo.objects.filter(
248
-        group_id=group_id,
249
-        status=True,
250
-        pk__gt=max(current_id, group_user.current_id),
251
-    ).order_by(
252
-        '-pk'
253
-    )
254
-    latest_photo = group_photos.first()
247
+    # group_photos = GroupPhotoInfo.objects.filter(
248
+    #     group_id=group_id,
249
+    #     status=True,
250
+    #     pk__gt=max(current_id, group_user.current_id),
251
+    # ).order_by(
252
+    #     '-pk'
253
+    # )
254
+    # latest_photo = group_photos.first()
255 255
 
256 256
     return response(200, 'Lensman Upload Photo Success', u'摄影师照片上传成功', {
257 257
         'group_id': group_id,
258
-        'current_id': latest_photo and latest_photo.pk or current_id,
259
-        'photos': [photo.photo_info(user_id) for photo in group_photos],
258
+        # 'current_id': latest_photo and latest_photo.pk or current_id,
259
+        # 'photos': [photo.photo_info(user_id) for photo in group_photos],
260 260
     })