コード例 #1
0
ファイル: saas_tags.py プロジェクト: shadowbw/djaodjin-saas
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
コード例 #2
0
ファイル: saas_tags.py プロジェクト: marmida/djaodjin-saas
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
コード例 #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
コード例 #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
コード例 #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
コード例 #6
0
ファイル: thread_locals.py プロジェクト: richardotis/djaoapp
def get_disabled_authentication(request):
    app = get_current_app()
    return (app.authentication == app.AUTH_DISABLED
            and not _valid_manager(request, [get_current_broker()]))
コード例 #7
0
ファイル: saas_tags.py プロジェクト: shadowbw/djaodjin-saas
def is_manager(request, organization):
    return _valid_manager(
        request.user, Organization.objects.filter(slug=organization))
コード例 #8
0
def is_manager(request, organization):
    return _valid_manager(request.user,
                          Organization.objects.filter(slug=organization))