Exemplo n.º 1
0
def render_template(template, mimetype=None, login_required=True):
    def renderer(request, *args, **kwargs):
        return render_to_response(template,
                                  kwargs,
                                  context_instance=RequestContext(request))

    return require_login(renderer) if login_required else renderer
Exemplo n.º 2
0
def render_template(template, mimetype=None, login_required=True):
    def renderer(request, *args, **kwargs):
        return render_to_response(
            template,
            kwargs,
            context_instance=RequestContext(request))
        
    return require_login(renderer) if login_required else renderer
Exemplo n.º 3
0
def render_template(template, mimetype=None, login_required=True, config_required=False):
    def renderer(request, *args, **kwargs):
        return render_to_response(
            template,
            kwargs,
            context_instance=RequestContext(request))
    
    action = renderer
    if login_required or config_required:
        action = require_login(action)
    if config_required:
        action = require_config(action)
    return action
Exemplo n.º 4
0
def render_template(template,
                    mimetype=None,
                    login_required=True,
                    config_required=False):
    def renderer(request, *args, **kwargs):
        return render_to_response(template,
                                  kwargs,
                                  context_instance=RequestContext(request))

    action = renderer
    if login_required or config_required:
        action = require_login(action)
    if config_required:
        action = require_config(action)
    return action
Exemplo n.º 5
0
    Verifies an unverified subscription and create or appends
    to an existing subscription.
    """
    
    try:
        unverified = UnverifiedSubscription.objects.get(ident=ident)
    except UnverifiedSubscription.DoesNotExist:
        return respond('overseer/invalid_subscription_token.html', {}, request)
    
    subscription = Subscription.objects.get_or_create(email=unverified.email, defaults={
        'ident': unverified.ident,
    })[0]

    subscription.services = unverified.services.all()
    
    unverified.delete()
    
    return respond('overseer/subscription_confirmed.html', {
        'subscription': subscription,
    }, request)


if conf.REQUIRE_LOGIN:
    from django.contrib.auth.decorators import login_required as require_login
    index = require_login(index)
    service = require_login(service)
    event = require_login(event)
    last_event = require_login(last_event)
    update_subscription = require_login(update_subscription)
    create_subscription = require_login(create_subscription)
    verify_subscription = require_login(verify_subscription)