Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bookshare
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
30
Issues
30
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
SRCT
bookshare
Commits
b20e703c
Commit
b20e703c
authored
Feb 25, 2020
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
is_authenticated is a propertie, not a method now
parent
4f042b70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
bookshare/settings/views.py
bookshare/settings/views.py
+1
-1
bookshare/trades/views.py
bookshare/trades/views.py
+2
-2
No files found.
bookshare/settings/views.py
View file @
b20e703c
...
...
@@ -16,7 +16,7 @@ class HomepageView(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
HomepageView
,
self
).
get_context_data
(
**
kwargs
)
if
self
.
request
.
user
.
is_authenticated
()
:
if
self
.
request
.
user
.
is_authenticated
:
context
[
'lookouts'
]
=
Lookout
.
objects
.
filter
(
owner
=
self
.
request
.
user
.
student
)
return
context
...
...
bookshare/trades/views.py
View file @
b20e703c
...
...
@@ -187,7 +187,7 @@ class ListingPage(View):
# https://docs.djangoproject.com/en/1.7/topics/class-based-views/mixins/#an-alternative-better-solution
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
if
self
.
request
.
user
.
is_authenticated
()
:
if
self
.
request
.
user
.
is_authenticated
:
view
=
DetailListing
.
as_view
()
return
view
(
request
,
*
args
,
**
kwargs
)
else
:
...
...
@@ -198,7 +198,7 @@ class ListingPage(View):
# rate limit is higher for bids
@
ratelimit
(
key
=
'user'
,
rate
=
'100/d'
,
method
=
'POST'
,
block
=
True
)
def
post
(
self
,
request
,
*
args
,
**
kwargs
):
if
self
.
request
.
user
.
is_authenticated
()
:
if
self
.
request
.
user
.
is_authenticated
:
view
=
CreateBid
.
as_view
()
return
view
(
request
,
*
args
,
**
kwargs
)
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment