Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Tezor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Tezor
Merge requests
!9
Resolve "Add payment processing UI"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Add payment processing UI"
3-add-payment-processing-ui-2
into
payment-backends
Overview
0
Commits
10
Pipelines
9
Changes
1
Merged
Tom Teichler
requested to merge
3-add-payment-processing-ui-2
into
payment-backends
3 years ago
Overview
0
Commits
10
Pipelines
9
Changes
1
Expand
Closes
#3 (closed)
Edited
3 years ago
by
Tom Teichler
0
0
Merge request reports
Viewing commit
b8817892
Prev
Next
Show latest version
1 file
+
3
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
b8817892
Fix predicate and add missing import
· b8817892
Tom Teichler
authored
3 years ago
aleksis/apps/tezor/predicates.py
+
3
−
1
Options
@@ -4,6 +4,8 @@ from rules import predicate
from
.models.invoice
import
Invoice
User
=
get_user_model
()
@predicate
def
is_own_invoice
(
user
:
User
,
obj
:
Invoice
):
"""
Predicate which checks if the invoice is linked to the current user.
"""
@@ -14,10 +16,10 @@ def has_no_payment_variant(user: User, obj: Invoice):
"""
Predicate which checks that the invoice has no payment variant.
"""
return
not
obj
.
variant
@predicate
def
is_in_payment_status
(
status
:
str
):
"""
Predicate which checks whether the invoice is in a specific state.
"""
@predicate
def
_predicate
(
user
:
User
,
obj
:
Invoice
):
return
obj
.
status
==
status
Loading