Skip to content
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

Do not access database from builds to check ad-free #4387

Merged
merged 1 commit into from
Jul 17, 2018

Conversation

davidfischer
Copy link
Contributor

There was an issue with the previous fix in #4329 which resulted in builders trying to access the database (project.gold_owners.exists makes a query). The builders don't have access to the database so this was a problem. Instead, this returns a show_advertising field on the API which checks both project.ad_free and project.gold_owners.exists.

The end result is that ad-free projects -- whether marked ad-free at the database level or because they have a Gold sponsor -- should not show the ad-block nag.

Fixes #4218

- Return "show_advertising" in the API
- Fallback to a property on the model
@davidfischer davidfischer requested a review from a team July 17, 2018 17:24
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Changes look good.

I tried to build different projects locally and they did pass. Although, we don't have a simple way to replicate production environment locally (builder instance without access to the db)

@humitos
Copy link
Member

humitos commented Jul 17, 2018

Some tests for 3.6 failed because a download problem of elasticsearch. I re-triggerred that job only but should pass.

@davidfischer davidfischer merged commit bb3c353 into master Jul 17, 2018
@stsewd stsewd deleted the davidfischer/ad-free-nag-fix branch August 15, 2018 22:24
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.

Blocking ads triggers nag even when no ad would be displayed
2 participants