Ejemplo n.º 1
0
def refund_enable(transaction, user):
    """
    Returns True if *user* is able to trigger a refund on *transaction*.
    """
    event = transaction.get_event()
    if event:
        return _valid_manager(user, [event.provider])
    return False
Ejemplo n.º 2
0
def refund_enable(transaction, user):
    """
    Returns True if *user* is able to trigger a refund on *transaction*.
    """
    subscription = Subscription.objects.filter(pk=transaction.event_id).first()
    if subscription:
        return _valid_manager(user, [subscription.plan.organization])
    return False
Ejemplo n.º 3
0
def refund_enable(transaction, user):
    """
    Returns True if *user* is able to trigger a refund on *transaction*.
    """
    subscription = Subscription.objects.filter(pk=transaction.event_id).first()
    if subscription:
        return _valid_manager(user, [subscription.plan.organization])
    return False
Ejemplo n.º 4
0
def refund_enable(transaction, user):
    """
    Returns True if *user* is able to trigger a refund on *transaction*.
    """
    event = transaction.get_event()
    if event:
        return _valid_manager(user, [event.provider])
    return False
Ejemplo n.º 5
0
def fail_edit_perm(request, account=None):
    """
    Returns ``True`` if the request user does not have edit permissions.
    """
    result = True
    # The context processor will be called from the e-mail sender
    # which might not be associated to a request.
    if request is not None:
        if account is None:
            account = get_current_app().account
        result = not bool(_valid_manager(request, [account]))
    return result
Ejemplo n.º 6
0
def get_disabled_authentication(request):
    app = get_current_app()
    return (app.authentication == app.AUTH_DISABLED
            and not _valid_manager(request, [get_current_broker()]))
Ejemplo n.º 7
0
def is_manager(request, organization):
    return _valid_manager(
        request.user, Organization.objects.filter(slug=organization))
Ejemplo n.º 8
0
def is_manager(request, organization):
    return _valid_manager(request.user,
                          Organization.objects.filter(slug=organization))