def render(self, context, instance, placeholder):
        ''' Create a UUID and check if a voucher with that ID exists before rendering '''
        context = super(GiftCertificateFormPlugin, self).render(context, instance, placeholder)

        # Paypal "live" mode is "production" to checkout.js
        mode = getattr(settings,'PAYPAL_MODE', 'sandbox')
        if mode == 'live':
            mode = 'production'

        context.update({
            'paypal_mode': mode,
        })

        return context
def render ( self , context , instance , placeholder ) : context = super ( GiftCertificateFormPlugin , self ) . render ( context , instance , placeholder ) mode = getattr ( settings , 'PAYPAL_MODE' , 'sandbox' ) if mode == 'live' : mode = 'production' context . update ( { 'paypal_mode' : mode , } ) return context
Create a UUID and check if a voucher with that ID exists before rendering