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
Commits
b8817892
Commit
b8817892
authored
3 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Fix predicate and add missing import
parent
a394002e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!9
Resolve "Add payment processing UI"
,
!3
Implement payment backends and interaction
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/tezor/predicates.py
+3
-1
3 additions, 1 deletion
aleksis/apps/tezor/predicates.py
with
3 additions
and
1 deletion
aleksis/apps/tezor/predicates.py
+
3
−
1
View file @
b8817892
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment