本文整理汇总了Python中Activity.check_person_on_team方法的典型用法代码示例。如果您正苦于以下问题:Python Activity.check_person_on_team方法的具体用法?Python Activity.check_person_on_team怎么用?Python Activity.check_person_on_team使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity.check_person_on_team方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: POST
# 需要导入模块: import Activity [as 别名]
# 或者: from Activity import check_person_on_team [as 别名]
def POST(self):
session = Activity.createSession('try')
web_input = web.input(new_picture={})
person_profile = {'objectId': web_input['objectId']}
teams = Activity.getLeadTeam(session, user_session.get('user')['name'])
rtn_url = web_input['rtn_url']
del web_input['rtn_url']
if web_input.new_picture.filename!='': #update the profile image
origin_full_filename="images/profile/origin_" +web_input.new_picture.filename
file_ext = web_input.new_picture.filename.split('.')[-1]
fout = open( origin_full_filename,'wb+')
fout.write(web_input.new_picture.file.read())
fout.close()
im = Image.open(origin_full_filename)
thumbnail_file_name= md5(open(origin_full_filename, 'rb').read()).hexdigest() + '.' + file_ext
im.thumbnail((140,140), Image.ANTIALIAS)
im.save("images/profile/" + thumbnail_file_name)
web_input.picture = thumbnail_file_name
remove(origin_full_filename)
if user_session.get('user')['access_level'] <=2: #manager
person_profile.update(web_input)
del person_profile['new_picture']
elif teams is not None: #TEAMLEAD
for team in teams:
if Activity.check_person_on_team(session, web_input['objectId'], team.objectId) :
person_profile['display_name'] = web_input['display_name']
person_profile['team'] = web_input['team']
person_profile['location'] = web_input['location']
person_profile['user_type'] = web_input['user_type']
person_profile['email'] = web_input['email']
person_profile['name'] = web_input['email'].split('@')[0]
break
if user_session.get('user')['display_name'] == web_input['display_name']: #person himself
person_profile['email'] = web_input['email']
person_profile['name'] = web_input['email'].split('@')[0]
if 'picture' in web_input.keys():
person_profile['picture'] = web_input['picture']
person_profile['mobile_num'] = web_input['mobile_num']
Activity.editPersonProfile(session, person_profile)
user_session.user.update(person_profile)
raise web.seeother(rtn_url)