def GetUserByAuth():
"""Returns current users profile."""
user_key = users.get_current_user().user_id()
user_key = ndb.Key('Profile', user_key)
profile = user_key.get()
for ledger in profile.user_ledger:
try:
price = GetPriceByPredictionId(ledger.prediction_id)
ledger.value = math.fabs((price * ledger.contract_one) - (
price * ledger.contract_two))
ledger.prediction_statement = ndb.Key(
urlsafe=ledger.prediction_id).get().statement
except:
ledger.value = 404
ledger.prediction_statement = 'ERROR'
return render_template('profile.html', profile=profile)
评论列表
文章目录