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

@davidfischer davidfischer commented Jul 17, 2018

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 Jul 17, 2018
Copy link
Member

@humitos humitos left a comment

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)

Loading

@humitos
Copy link
Member

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

Loading

@davidfischer davidfischer merged commit bb3c353 into master Jul 17, 2018
1 check passed
Loading
@stsewd stsewd deleted the davidfischer/ad-free-nag-fix branch Aug 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants