Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Onboarding
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
3lisvequii
Onboarding
Commits
66eb9461
Commit
66eb9461
authored
3 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Finish implementation of changing payment method
parent
0a100d45
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/apps/tezor/rules.py
+6
-1
6 additions, 1 deletion
aleksis/apps/tezor/rules.py
aleksis/apps/tezor/templates/tezor/invoice/full.html
+1
-1
1 addition, 1 deletion
aleksis/apps/tezor/templates/tezor/invoice/full.html
aleksis/apps/tezor/views.py
+7
-6
7 additions, 6 deletions
aleksis/apps/tezor/views.py
with
14 additions
and
8 deletions
aleksis/apps/tezor/rules.py
+
6
−
1
View file @
66eb9461
...
...
@@ -11,7 +11,12 @@ from aleksis.core.util.predicates import (
from
.models.base
import
Client
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_predicate
=
has_person
&
(
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/templates/tezor/invoice/full.html
+
1
−
1
View file @
66eb9461
...
...
@@ -75,7 +75,7 @@
<td>
<select
name=
"variant"
{%
if
not
can_change_variant
%}
disabled
{%
endif
%}
>
{% for choice in object.get_variant_choices %}
<option
value=
"{{ choice.0 }}"
{%
if
object.
get_
variant
_name
=
=
choice.0
%}
selected
{%
endif
%}
>
{{ choice.1 }}
</option>
<option
value=
"{{ choice.0 }}"
{%
if
object.variant =
=
choice.0
%}
selected
{%
endif
%}
>
{{ choice.1 }}
</option>
{% endfor %}
</select>
</td>
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/views.py
+
7
−
6
View file @
66eb9461
from
django.conf
import
settings
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.shortcuts
import
get_object_or_404
,
redirect
,
render
from
django.urls
import
reverse_lazy
from
django.utils.decorators
import
method_decorator
...
...
@@ -45,14 +46,14 @@ class DoPaymentView(PermissionRequiredMixin, View):
new_variant
=
request
.
GET
.
get
(
"
variant
"
,
None
)
if
new_variant
:
if
xxx_
has_perm
(
"
tezor.change_payment_variant
"
,
self
.
object
):
# FIXME
if
variant
in
settings
.
PAYMENT_VARIANTS
:
object
.
variant
=
variant
object
.
save
()
if
request
.
user
.
has_perm
(
"
tezor.change_payment_variant
"
,
self
.
object
):
if
new_
variant
in
settings
.
PAYMENT_VARIANTS
:
self
.
object
.
variant
=
new_
variant
self
.
object
.
save
()
else
:
raise
xxxbadrequest
# FIXME
raise
SuspiciousOperation
()
else
:
raise
p
ermission
d
enied
# FIXME
raise
P
ermission
D
enied
()
if
self
.
object
.
status
not
in
[
PaymentStatus
.
WAITING
,
...
...
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