Skip to content

Conversation

@iambibhas
Copy link
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
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
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
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
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
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

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.
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.

4 participants