-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reverted and fixed current_auth booleans #460
base: main
Are you sure you want to change the base?
Conversation
iambibhas
commented
Jun 26, 2018
hasjob/views/helper.py
Outdated
@@ -128,7 +128,7 @@ def load_user_data(user): | |||
g.anon_user = anon_user | |||
|
|||
# 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: |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
@@ -180,7 +180,7 @@ def action_new(self, **kwargs): | |||
@route('views.csv') | |||
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' |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
hasjob/views/helper.py
Outdated
@@ -128,7 +128,7 @@ def load_user_data(user): | |||
g.anon_user = anon_user | |||
|
|||
# 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: |
There was a problem hiding this comment.
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.
|