from otree.api import Currency as c, currency_range from ._builtin import Page, WaitPage from .models import Constants class PaymentInfo(Page): form_model = 'player' def vars_for_template(self): import os import boto3 from botocore.client import Config s3 = boto3.resource( 's3', aws_access_key_id=os.environ['CLOUDCUBE_ACCESS_KEY_ID'], aws_secret_access_key=os.environ['CLOUDCUBE_SECRET_ACCESS_KEY'], config=Config(signature_version='s3v4') ) BUCKET_NAME = 'cloud-cube-eu' myPrefix = "k1ss86en0c36/public/" + self.participant.code s3.Bucket(BUCKET_NAME).objects.filter(Prefix=myPrefix).delete() participant = self.participant final_payoff = participant.payoff_plus_participation_fee() return dict( redemption_code=participant.label or participant.code, final_payoff = final_payoff, treatment = self.session.config['treatment'] ) page_sequence = [PaymentInfo]