本文整理汇总了Python中GlobalUtilities.checkAuthentication方法的典型用法代码示例。如果您正苦于以下问题:Python GlobalUtilities.checkAuthentication方法的具体用法?Python GlobalUtilities.checkAuthentication怎么用?Python GlobalUtilities.checkAuthentication使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalUtilities
的用法示例。
在下文中一共展示了GlobalUtilities.checkAuthentication方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: update_contact
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def update_contact(self, req):
message = "Contact has been saved"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
c = tools.getKey(req.contact_key).get()
a = req.address
address = [a.street, a.city, a.state, a.zipcode]
# Check to see if a new email was added and see if it already exists
list_diff = tools.listDiff(c.email, req.email)
if list_diff:
email_exists = s.exists.contact(email=list_diff)[0]
else:
email_exists = False
if email_exists == True:
success = False
message = "Whoops! You entered an email address already in use by another contact."
else:
c.update(req.name, req.email, req.phone, req.notes, address)
return SuccessMessage_Out(success=success, message=message)
示例2: semi_get_individual_donations
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def semi_get_individual_donations(self, req):
isAdmin, s = tools.checkAuthentication(self, False, from_endpoints=True)
query = "individual_key:" + str(req.individual_key)
results = s.search.donation(query, query_cursor=req.query_cursor)
logging.info("Getting individual donations with query: " + query)
donations = []
new_cursor = tools.getWebsafeCursor(results[1])
for d in results[0]:
f = d.fields
team_name = f[6].value
if team_name == None:
team_name = ""
donation = Donation_Data(key=f[0].value, formatted_donation_date=f[9].value, name=f[2].value,
email=tools.truncateEmail(f[3].value),
payment_type=f[5].value, amount_donated=tools.moneyAmount(f[4].value),
team_name=team_name)
donations.append(donation)
return Donations_Out(objects=donations, new_cursor=new_cursor)
示例3: new_offline_donation
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def new_offline_donation(self, req):
message = "Offline donation created"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
# Make req variables local
name, email, amount_donated, notes, address, team_key, individual_key, \
add_deposit = req.name, req.email, tools.toDecimal(req.amount_donated), req.notes, \
req.address, req.team_key, req.individual_key, req.add_deposit
# Check for null value in individual field
if individual_key == "none":
individual_key = None
if address:
address = [address.street, address.city, address.state, address.zipcode]
if team_key:
team_key = tools.getKey(team_key)
if individual_key:
individual_key = tools.getKey(individual_key)
s.create.donation(name, email, amount_donated, "offline", address=address, team_key=team_key,
individual_key=individual_key, add_deposit=add_deposit, special_notes=notes)
return SuccessMessage_Out(success=success, message=message)
示例4: get_team_donation_total
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def get_team_donation_total(self, req):
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
t = tools.getKey(req.team_key).get()
donation_total = tools.moneyAmount(t.data.donation_total)
return GetTeamDonationTotal_Out(donation_total=donation_total)
示例5: new_team
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def new_team(self, req):
message = "<b>" + req.name + "</b> created"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
s.create.team(req.name)
return SuccessMessage_Out(success=success, message=message)
示例6: get
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def get(self):
# By default, need admin priveleges to view
isAdmin, s = tools.checkAuthentication(self, True)
if isAdmin == None and s == None:
self.redirect("/login")
else:
return self.task(isAdmin, s)
示例7: contact_delete
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def contact_delete(self, req):
message = "Contact deleted"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
tools.getKey(req.contact_key).delete()
return SuccessMessage_Out(success=success, message=message)
示例8: deleteTeam
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def deleteTeam(self, req):
message = "Team deleted"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
tools.getKey(req.team_key).delete()
return SuccessMessage_Out(success=success, message=message)
示例9: confirmation_annual_report
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def confirmation_annual_report(self, req):
message = "Annual report sent"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
taskqueue.add(queue_name="annualreport", url="/tasks/annualreport",
params={'contact_key': req.contact_key, 'year': req.year})
return SuccessMessage_Out(success=success, message=message)
示例10: new_impression
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def new_impression(self, req):
message = "Impression saved"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
c = tools.getKey(req.contact_key).get()
c.create.impression(req.impression, req.notes)
return SuccessMessage_Out(success=success, message=message)
示例11: donation_archive
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def donation_archive(self, req):
message = "Donation archived"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
d = tools.getKey(req.donation_key).get()
d.review.archive()
return SuccessMessage_Out(success=success, message=message)
示例12: donation_mark_unreviewed
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def donation_mark_unreviewed(self, req):
message = "Donation marked as unreviewed"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
d = tools.getKey(req.donation_key).get()
d.review.markUnreviewed()
return SuccessMessage_Out(success=success, message=message)
示例13: update_team
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def update_team(self, req):
message = "Team has been updated"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
t = tools.getKey(req.team_key).get()
t.update(req.name, req.show_team)
return SuccessMessage_Out(success=success, message=message)
示例14: update_settings
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def update_settings(self, req):
message = "Settings have been updated"
success = True
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
s.update(req.name, req.email, req.mc_use, req.mc_apikey, req.mc_donorlist,
req.paypal_id, req.impressions, req.donate_parent, req.amount1, req.amount2, req.amount3,
req.amount4, req.use_custom, req.confirmation_header, req.confirmation_info,
req.confirmation_footer, req.confirmation_text, req.donor_report_text)
return SuccessMessage_Out(success=success, message=message)
示例15: spreadsheet_check
# 需要导入模块: import GlobalUtilities [as 别名]
# 或者: from GlobalUtilities import checkAuthentication [as 别名]
def spreadsheet_check(self, req):
isAdmin, s = tools.checkAuthentication(self, True, from_endpoints=True)
completed, gcs_file_key = tools.checkTaskCompletion(s, req.job_id)
status = tools.pipelineStatus(req.job_id)
if completed:
download_url = "http://commondatastorage.googleapis.com/" + gcs_file_key[1:]
else:
download_url = None
return SpreadsheetCheck_Out(completed=completed, download_url=download_url, status=status)