Skip to content

reverted and fixed current_auth booleans#460

Open
iambibhas wants to merge 2 commits intomainfrom
current-auth-fix
Open

reverted and fixed current_auth booleans#460
iambibhas wants to merge 2 commits intomainfrom
current-auth-fix

Conversation

@iambibhas
Copy link
Copy Markdown
Contributor

if g.user:                   -   if current_auth.not_anonymous
if not g.user:               -   if current_auth.is_anonymous
if g.user or g.anon_user:    -   if current_auth.is_authenticated
if g.anon_user:              -   if current_auth.is_authenticated and current_auth.is_anonymous

@iambibhas iambibhas requested a review from jace June 26, 2018 08:35

# Prepare event session if it's not already present
if current_auth or g.anon_user and not g.esession:
if current_auth and not g.esession:
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because current_auth checks for g.user or g.anon_user.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only true if Hasjob is reporting g.anon_user to current_auth as an actor, which has not been handled yet in this PR. This was reserved for a future PR.

def view_counts(self, **kwargs):
campaign = self.obj
timezone = current_auth.actor.timezone if current_auth else 'UTC'
timezone = current_auth.actor.timezone if current_auth.not_anonymous else 'UTC'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one can be current_auth.actor.timezone if current_auth else 'UTC' provided the AnonUser object reports a timezone (which it should).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not setting and using g.anon_user until we close that other PR that moved AnonUser to mouse interaction. So gonna leave it like this for now and fix it when I close that other PR.


# Prepare event session if it's not already present
if current_auth or g.anon_user and not g.esession:
if current_auth and not g.esession:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only true if Hasjob is reporting g.anon_user to current_auth as an actor, which has not been handled yet in this PR. This was reserved for a future PR.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 16, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Bibhas seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants