Skip to content

Commit 60d0c7a

Browse files
committed
Use user.is_authenticated as property
1 parent 672c754 commit 60d0c7a

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

junction/conferences/permissions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
def is_reviewer(user, conference):
77
"""Returns a boolean indicating if a given user is a conference reviewer.
88
"""
9-
if not user.is_authenticated():
9+
if not user.is_authenticated:
1010
return False
1111

1212
qs = ConferenceProposalReviewer.objects.filter(

junction/proposals/permissions.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ def is_proposal_voting_allowed(proposal):
1313

1414

1515
def is_proposal_author(user, proposal):
16-
return user.is_authenticated() and proposal.author == user
16+
return user.is_authenticated and proposal.author == user
1717

1818

1919
def is_proposal_reviewer(user, conference):
20-
authenticated = user.is_authenticated()
20+
authenticated = user.is_authenticated
2121
is_reviewer = ConferenceProposalReviewer.objects.filter(
2222
reviewer=user.id, conference=conference, active=True
2323
).exists()
@@ -26,7 +26,7 @@ def is_proposal_reviewer(user, conference):
2626

2727
def is_proposal_section_reviewer(user, conference, proposal):
2828
return (
29-
user.is_authenticated()
29+
user.is_authenticated
3030
and ProposalSectionReviewer.objects.filter(
3131
conference_reviewer__reviewer=user,
3232
conference_reviewer__conference=conference,

junction/proposals/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def detail_proposal(request, conference_slug, slug, hashid=None):
234234
if public_voting_setting:
235235
public_voting_setting_value = public_voting_setting.value
236236
try:
237-
if request.user.is_authenticated():
237+
if request.user.is_authenticated:
238238
proposal_vote = ProposalVote.objects.get(
239239
proposal=proposal, voter=request.user
240240
)

0 commit comments

Comments
 (0)