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
236d7961
Commit
236d7961
authored
3 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Add view to view invoices
parent
6236389a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/tezor/urls.py
+1
-1
1 addition, 1 deletion
aleksis/apps/tezor/urls.py
aleksis/apps/tezor/views.py
+15
-6
15 additions, 6 deletions
aleksis/apps/tezor/views.py
with
16 additions
and
7 deletions
aleksis/apps/tezor/urls.py
+
1
−
1
View file @
236d7961
...
...
@@ -3,6 +3,6 @@ from django.urls import include, path
from
.
import
views
urlpatterns
=
[
path
(
"
empty
"
,
views
.
empty
,
name
=
"
empty
"
),
path
(
"
payments/
"
,
include
(
"
payments.urls
"
)),
path
(
"
invoice/<int:pk>/print
"
,
views
.
GetInvoicePDF
.
as_view
(),
name
=
"
get_invoice_by_pk
"
)
]
This diff is collapsed.
Click to expand it.
aleksis/apps/tezor/views.py
+
15
−
6
View file @
236d7961
from
django.contrib.auth.decorators
import
login_required
from
django.http
import
HttpRequest
,
HttpResponse
from
django.views.generic
import
View
from
django.shortcuts
import
render
from
rules.contrib.views
import
PermissionRequiredMixin
@login_required
def
empty
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
from
.models.invoice
import
Invoice
class
GetInvoicePDF
(
PermissionRequiredMixin
,
View
):
permission_required
=
"
tezor.can_print_invoice
"
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
context
=
{}
invoice
=
Invoice
.
objects
.
get
(
id
=
self
.
kwargs
[
"
pk
"
])
context
[
"
invoice
"
]
=
invoice
return
render
(
request
,
invoice
.
group
.
template_name
,
context
=
context
)
return
render
(
request
,
"
tezor/empty.html
"
,
context
)
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