def execute(self): try: user = User.get(id=self.user_id) user.nickname = self.nickname if self.nickname else user.nickname user.head_img_url = self.head_img_url if self.head_img_url else user.head_img_url user.save() except Exception, e: return self.mk_response(False, str(e))
def execute(self): try: user = User.get(id=self.user_id) except: return self.mk_response(None) user_info = UserInfo(user_id=user.id, openid=user.openid, nickname=user.nickname, head_img_url=user.head_img_url, create_time=utils.datetime2timestamp( user.create_time)) return self.mk_response(user_info)