fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56de019
)
Funding offer staff preview.
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 18 Jan 2021 12:32:15 +0000
(13:32 +0100)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 18 Jan 2021 12:32:15 +0000
(13:32 +0100)
src/funding/views.py
patch
|
blob
|
history
diff --git
a/src/funding/views.py
b/src/funding/views.py
index
91dafc1
..
5d4669e
100644
(file)
--- a/
src/funding/views.py
+++ b/
src/funding/views.py
@@
-77,7
+77,11
@@
class OfferDetailView(FormView):
def dispatch(self, request, slug=None):
if getattr(self, 'object', None) is None:
if slug:
- self.object = get_object_or_404(Offer.public(), slug=slug)
+ if request.user.is_staff:
+ offers = Offer.objects.all()
+ else:
+ offers = Offer.public()
+ self.object = get_object_or_404(offers, slug=slug)
else:
self.object = Offer.current()
if self.object is None: