Skip to content
Snippets Groups Projects
Commit 2989bc01 authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Merge branch '5-add-a-possibility-to-change-the-payment-method-of-an-invoice'...

Merge branch '5-add-a-possibility-to-change-the-payment-method-of-an-invoice' of edugit.org:AlekSIS/onboarding/AlekSIS-App-Tezor into 5-add-a-possibility-to-change-the-payment-method-of-an-invoice
parents 5070d08b 18d2e285
No related branches found
No related tags found
1 merge request!13Resolve "Add a possibility to change the payment method of an invoice"
Pipeline #59947 failed
...@@ -11,7 +11,12 @@ from aleksis.core.util.predicates import ( ...@@ -11,7 +11,12 @@ from aleksis.core.util.predicates import (
from .models.base import Client from .models.base import Client
from .models.invoice import InvoiceGroup from .models.invoice import InvoiceGroup
from .predicates import has_no_payment_variant, has_payment_variant, is_in_payment_status, is_own_invoice from .predicates import (
has_no_payment_variant,
has_payment_variant,
is_in_payment_status,
is_own_invoice,
)
# View clients # View clients
view_clients_predicate = has_person & ( view_clients_predicate = has_person & (
...@@ -97,7 +102,10 @@ change_payment_variant_predicate = ( ...@@ -97,7 +102,10 @@ change_payment_variant_predicate = (
has_person has_person
& is_in_payment_status(PaymentStatus.WAITING) & is_in_payment_status(PaymentStatus.WAITING)
& ( & (
(is_own_invoice & (has_no_payment_variant | has_payment_variant("pledge"))) (
(is_own_invoice | is_site_preference_set("payments", "public_payments"))
& (has_no_payment_variant | has_payment_variant("pledge"))
)
| has_global_perm("tezor.change_payment_variant") | has_global_perm("tezor.change_payment_variant")
| has_object_perm("tezor.change_payment_variant") | has_object_perm("tezor.change_payment_variant")
) )
......
from django.conf import settings from django.conf import settings
from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.http import HttpResponseBadRequest
from django.shortcuts import get_object_or_404, redirect, render from django.shortcuts import get_object_or_404, redirect, render
from django.urls import reverse_lazy from django.urls import reverse_lazy
from django.utils.decorators import method_decorator from django.utils.decorators import method_decorator
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment