fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bc4023d
)
pz admin fix
author
Radek Czajka
<rczajka@rczajka.pl>
Tue, 12 Oct 2021 13:38:31 +0000
(15:38 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Tue, 12 Oct 2021 13:38:31 +0000
(15:38 +0200)
src/pz/admin.py
patch
|
blob
|
history
diff --git
a/src/pz/admin.py
b/src/pz/admin.py
index
6c51aef
..
25c700b
100644
(file)
--- a/
src/pz/admin.py
+++ b/
src/pz/admin.py
@@
-130,9
+130,12
@@
class BankOrderAdmin(admin.ModelAdmin):
return fields
def download(self, obj):
- return mark_safe('<a href="{}">Download</a>'.format(
- reverse('admin:pz_bankorder_download', args=[obj.pk])
- ))
+ if obj is not None and obj.pk:
+ return mark_safe('<a href="{}">Download</a>'.format(
+ reverse('admin:pz_bankorder_download', args=[obj.pk])
+ ))
+ else:
+ return ''
def get_urls(self):
urls = super().get_urls()