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

Show/Hide "See paid advertising" checkbox depending on USE_PROMOS #3412

Merged
merged 6 commits into from
Dec 21, 2017

Conversation

humitos
Copy link
Member

@humitos humitos commented Dec 18, 2017

No description provided.

@@ -313,6 +313,7 @@ def INSTALLED_APPS(self): # noqa

# Misc application settings
GLOBAL_ANALYTICS_CODE = 'UA-17997319-1'
USE_PROMOS = False
Copy link
Member

Choose a reason for hiding this comment

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

Thoughts on doing this dynamically by checking for the donate app? That's how it's done other places (settings, urls) for the ad stuff.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't have a position on this since I don't konw what the donate app really involves and if it would fit correctly here. Besdies, wasn't the variable/app renamed to readthedocs-ext?

If it fits correctly, I'm 👍

On the other hand, this way with just a setting it's very easy to understand, override and follow. Maybe base this into an installed app adds a confusing layer when it's not necessary and we don't have many benefits.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the promo code doesn't work without readthedocs-ext installed, then doing dynamically based on the package being imported seems like a good choice.

fields = ['first_name', 'last_name', 'homepage', 'allow_ads']
if not settings.USE_PROMOS:
Copy link
Member

Choose a reason for hiding this comment

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

I think its better to append allow_ads instead of deleting from index.
It can be something like

fields = ['first_name', 'last_name', 'homepage']
if settings.USE_PROMOS:
    fields.append('allow_ads')

@humitos humitos force-pushed the humitos/profile/allow-promos branch from ecf5b79 to c9ce5ff Compare December 20, 2017 21:56
@humitos
Copy link
Member Author

humitos commented Dec 21, 2017

This PR should be ready to go :)

@ericholscher ericholscher merged commit 561d15d into master Dec 21, 2017
@stsewd stsewd deleted the humitos/profile/allow-promos branch August 15, 2018 22:15
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