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
5070d08b
Commit
5070d08b
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
1 merge request
!13
Resolve "Add a possibility to change the payment method of an invoice"
Pipeline
#59911
failed
3 years ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
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
+8
-6
8 additions, 6 deletions
aleksis/apps/tezor/views.py
with
9 additions
and
7 deletions
aleksis/apps/tezor/templates/tezor/invoice/full.html
+
1
−
1
View file @
5070d08b
...
...
@@ -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
+
8
−
6
View file @
5070d08b
from
django.conf
import
settings
from
django.core.exceptions
import
PermissionDenied
,
SuspiciousOperation
from
django.http
import
HttpResponseBadRequest
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 +47,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