Commit 7face98e authored by haowang's avatar haowang

fix code

parent 7fd8ac80
...@@ -34,6 +34,7 @@ class CreatePictorial(BaseView): ...@@ -34,6 +34,7 @@ class CreatePictorial(BaseView):
def get_user_id(self, id_, platform): def get_user_id(self, id_, platform):
cache_key = 'grap:{}:{}'.format(platform, id_) cache_key = 'grap:{}:{}'.format(platform, id_)
exist_key = 'grap:{}:{}' exist_key = 'grap:{}:{}'
# print(cache_key)
value = ins_cache.get(cache_key) value = ins_cache.get(cache_key)
user_id = None user_id = None
if not value: if not value:
...@@ -86,11 +87,10 @@ class CreatePictorial(BaseView): ...@@ -86,11 +87,10 @@ class CreatePictorial(BaseView):
obj['from_id'] = from_id obj['from_id'] = from_id
obj['content'] = obj.get('comment') obj['content'] = obj.get('comment')
reply = obj.pop('reply', None) reply = obj.pop('reply', None)
if not reply:
ret.append(obj) ret.append(obj)
if not reply:
continue continue
for info in reply: for info in reply:
ret.append(obj)
info['from_id'] = obj.get('from_id') info['from_id'] = obj.get('from_id')
info['reply_id'] = obj.get('id') info['reply_id'] = obj.get('id')
info['type'] = obj.get('type') info['type'] = obj.get('type')
......
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