-
Notifications
You must be signed in to change notification settings - Fork 80
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?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,7 @@ def index_is_paginated(): | |
|
||
def has_post_stats(post): | ||
is_siteadmin = lastuser.has_permission('siteadmin') | ||
return is_siteadmin or post.admin_is(g.user) or (current_auth and g.user.flags.get('is_employer_month')) | ||
return is_siteadmin or post.admin_is(g.user) or (current_auth.not_anonymous and g.user.flags.get('is_employer_month')) | ||
|
||
|
||
@form_validation_success.connect | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only true if Hasjob is reporting |
||
g.esession = EventSession.get_session(uuid=session.get('es'), user=g.user, anon_user=g.anon_user) | ||
if g.esession: | ||
session['es'] = g.esession.uuid | ||
|
@@ -254,7 +254,7 @@ def record_views_and_events(response): | |
if g.impressions: | ||
g.event_data['impressions'] = g.impressions.values() | ||
|
||
if current_auth: | ||
if current_auth.not_anonymous: | ||
for campaign in g.campaign_views: | ||
if not CampaignView.exists(campaign, g.user): | ||
db.session.begin_nested() | ||
|
@@ -278,7 +278,7 @@ def record_views_and_events(response): | |
campaign_view_count_update.delay(campaign_id=campaign.id, anon_user_id=g.anon_user.id) | ||
|
||
if g.esession: # Will be None for anon static requests | ||
if current_auth or g.anon_user: | ||
if current_auth: | ||
ue = UserEvent.new_from_request(request) | ||
else: | ||
ue = UserEventBase.new_from_request(request) | ||
|
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.