Skip to content

Commit

Permalink
Use user.is_authenticated as property
Browse files Browse the repository at this point in the history
  • Loading branch information
sks444 committed Apr 9, 2020
1 parent 2de9278 commit 1db0a20
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion junction/conferences/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
def is_reviewer(user, conference):
"""Returns a boolean indicating if a given user is a conference reviewer.
"""
if not user.is_authenticated():
if not user.is_authenticated:
return False

qs = ConferenceProposalReviewer.objects.filter(
Expand Down
6 changes: 3 additions & 3 deletions junction/proposals/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def is_proposal_voting_allowed(proposal):


def is_proposal_author(user, proposal):
return user.is_authenticated() and proposal.author == user
return user.is_authenticated and proposal.author == user


def is_proposal_reviewer(user, conference):
authenticated = user.is_authenticated()
authenticated = user.is_authenticated
is_reviewer = ConferenceProposalReviewer.objects.filter(
reviewer=user.id, conference=conference, active=True
).exists()
Expand All @@ -26,7 +26,7 @@ def is_proposal_reviewer(user, conference):

def is_proposal_section_reviewer(user, conference, proposal):
return (
user.is_authenticated()
user.is_authenticated
and ProposalSectionReviewer.objects.filter(
conference_reviewer__reviewer=user,
conference_reviewer__conference=conference,
Expand Down
2 changes: 1 addition & 1 deletion junction/proposals/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ def detail_proposal(request, conference_slug, slug, hashid=None):
if public_voting_setting:
public_voting_setting_value = public_voting_setting.value
try:
if request.user.is_authenticated():
if request.user.is_authenticated:
proposal_vote = ProposalVote.objects.get(
proposal=proposal, voter=request.user
)
Expand Down

0 comments on commit 1db0a20

Please sign in to comment.