-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
[#6434] Exclude email providers from body home pages #7836
Conversation
Any others we should add as defaults for Alaveteli? Can't cover every email provider but should include the most common international ones. |
Might want to show appending domains for configuration too:
|
gmail, outlook, aol, gmx, mail.com, hotmail, iCloud, proton, yahoo. - QQ, zoho, yandex and mail.ru are big but a bit more region specific. |
1e1243c
to
e811f1e
Compare
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.
The list of domains makes sense - but, a scan of the wdtk database suggests some additions would be helpful 1.
It seems to make sense to put them here, rather than branch them out on wdtk-theme, as they are possibly also of use to others.
Footnotes
-
Primarily UK ISPs, but also the uk variants of Hotmail. Sadly, we have loads of them, primarily in small Government organisations. ↩
Thanks, I'll add these variants. 🙌 Might pop the |
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 all looks good to me. Happy with the suggestions or we can bump some of those over to the theme.
* Group related specs (adding protocol, then guessing based on domain) * Quote style * Missing parenthesis * Set attribute on initialisation * Remove “should” from spec descriptions
Going to later add a list of domains to exclude from the calculation so moving to a module to contain related logic.
Many smaller authorities use a request email address from a general purpose public email provider. We don't want e.g. gmail.com being set as the home page for the authority. This is configurable in the theme by setting the class attribute: # Add to the defaults PublicBody.excluded_calculated_home_page_domains << %w[ example.net ] # Clear the defaults and set your own list PublicBody.excluded_calculated_home_page_domains = %w[ example.org example.net ] Fixes #6434
Removes the TODO by adding a cached and non-cached version of PublicBody::CalculatedHomePage#calculated_home_page. In current use it's safe to always use the cached version. In future we might want to modify the non-bang version such that it recalculates if the request_email attribute gets changed.
Extract each piece of logic to own method to improve clarity.
e811f1e
to
de37074
Compare
I've refined this PR so that it covers international providers and made a counterpart PR for UK domains at theme level mysociety/whatdotheyknow-theme#1789 |
@garethrees I'm going to get this merged unless there is any reason not to have this in #6676? |
If we can we should run it in prod for a bit this morning just to check it all seems okay, but in general I don't see why not. 🚀 |
Many smaller authorities use a request email address from a general
purpose public email provider. We don't want e.g. gmail.com being set as
the home page for the authority.
This is configurable in the theme by setting the class attribute:
Fixes #6434