Commit 97970a68 authored by 王浩's avatar 王浩

fix code

parent 21705bc8
......@@ -54,7 +54,7 @@ class PictorialUpdateOrCreate(APIView):
'description': request.POST.get('description', ''),
'creator_id': request.POST.get('creator_id', ''),
'celebrity_ids': star_ids,
'is_online': int(request.POST.get('is_online', 0)),
'is_online': int(request.POST.get('is_online', 1)),
'is_recommend': int(request.POST.get('is_recommend', 0)),
'pictorial_user_ids': pictorial_user_ids,
'icon': request.POST.get('icon', ''),
......
......@@ -79,14 +79,14 @@ class CelebrityUpdateOrCreate(APIView):
}
class CelebrityRelatedGroup(APIView):
class CelebrityRelatedPictorial(APIView):
def get(self, request):
id = request.GET.get('id')
offset = int(request.GET.get('page', 0))
count = int(request.GET.get('limit', 10))
filters = {'star_id': id, 'is_online': True}
try:
data = self.rpc['venus/sun/group/list'](filters=filters, offset=(offset-1) * count, limit=count).unwrap()
data = self.rpc['venus/sun/pictorial/list'](filters=filters, offset=(offset-1) * count, limit=count).unwrap()
except Exception as e:
error_logger.error(u'获取%d明星小组信息失败%s' % (id, e))
raise
......
......@@ -66,7 +66,7 @@ urlpatterns = [
url(r'^celebrity/list/update$', CelebrityListView.as_view()),
url(r'^celebrity/create$', CelebrityUpdateOrCreate.as_view()),
url(r'^celebrity/detail$', CelebrityUpdateOrCreate.as_view()),
url(r'^celebrity/celebrity_related_group_info', CelebrityRelatedGroup.as_view()),
url(r'^celebrity/celebrity_related_pictorial_info', CelebrityRelatedPictorial.as_view()),
# push相关
url(r'^push/list$', PushListView.as_view()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment