Exemplo n.º 1
0
def send_validation(strategy, backend, code):
    '''
    Sends verification email.
    '''

    # We need to have existing session
    if not strategy.request.session.session_key:
        strategy.request.session.create()

    template = 'activation'
    if strategy.request.session.pop('password_reset', False):
        template = 'reset'

    url = '{}?verification_code={}&id={}'.format(
        reverse('social:complete', args=(backend.name,)),
        code.code,
        strategy.request.session.session_key
    )

    send_notification_email(
        None,
        code.email,
        template,
        info=code.code,
        context={
            'url': url
        }
    )
Exemplo n.º 2
0
def send_validation(strategy, backend, code):
    '''
    Sends verification email.
    '''

    # We need to have existing session
    if not strategy.request.session.session_key:
        strategy.request.session.create()

    template = 'activation'
    if strategy.request.session.pop('password_reset', False):
        template = 'reset'

    url = '{}?verification_code={}&id={}'.format(
        reverse('social:complete', args=(backend.name,)),
        code.code,
        strategy.request.session.session_key
    )

    send_notification_email(
        None,
        code.email,
        template,
        info=code.code,
        context={
            'url': url
        }
    )
Exemplo n.º 3
0
def send_validation(strategy, code):
    '''
    Sends verification email.
    '''
    url = '{}?verification_code={}'.format(
        reverse('social:complete', args=(get_backend_name(strategy), )),
        code.code)

    send_notification_email(None,
                            code.email,
                            'activation',
                            info=code.code,
                            context={'url': url})
Exemplo n.º 4
0
def send_validation(strategy, code):
    '''
    Sends verification email.
    '''
    url = '{}?verification_code={}'.format(
        reverse('social:complete', args=(get_backend_name(strategy),)),
        code.code
    )

    send_notification_email(
        None,
        code.email,
        'activation',
        info=code.code,
        context={
            'url': url
        }
    )