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

[Hotfix][PLAT-1014] Fix email write only #8590

Merged

Conversation

Johnetordoff
Copy link
Contributor

Purpose

We don't want to show the email for contributors that have just been added.

Changes

  • makes email write-only
  • adds test

QA Notes

If you add a contributor you should see the contributor's email in the response.

Documentation

Not a user facing change,

Side Effects

None that I know of.

Ticket

https://openscience.atlassian.net/browse/PLAT-1014

@coveralls
Copy link

coveralls commented Jul 30, 2018

Pull Request Test Coverage Report for Build 30784

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 10445 unchanged lines in 229 files lost coverage.
  • Overall coverage increased (+0.5%) to 72.099%

Files with Coverage Reduction New Missed Lines %
osf/models/node_relation.py 1 92.86%
addons/twofactor/models.py 1 97.5%
website/ember_osf_web/decorators.py 1 100.0%
website/prereg/views.py 1 100.0%
addons/bitbucket/models.py 1 85.07%
addons/googledrive/models.py 1 94.31%
website/prereg/utils.py 1 100.0%
api/taxonomies/utils.py 1 100.0%
api/test/views.py 1 100.0%
website/citations/utils.py 1 100.0%
Totals Coverage Status
Change from base Build 30777: 0.5%
Covered Lines: 27301
Relevant Lines: 37866

💛 - Coveralls

@@ -952,7 +962,7 @@ def test_add_unregistered_contributor_with_fullname(
project_public.reload()
assert res.status_code == 201
assert res.json['data']['attributes']['unregistered_contributor'] == 'John Doe'
assert res.json['data']['attributes']['email'] is None
assert res.json['data']['attributes'].get('email') is None
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: no need for the code to be defensive in tests. Better to be...assertive 😅 ... about what is expected. In other words, if email isn't expected to be in attributes, test that directly.

assert 'email' not in res.json['data']['attributes']

@sloria sloria merged commit 81c1500 into CenterForOpenScience:master Jul 30, 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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants