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

Issue #DCC649 - Fix for the contributor to fail to save on Contributor #3060

Conversation

johnpinto1
Copy link
Contributor

@johnpinto1 johnpinto1 commented Nov 3, 2021

page if not required Affiliation field not set.

Fix for DCC bug https://github.com/DigitalCurationCentre/DMPonline-Service/issues/649

Changes:

  • In ContributorsController an if condition has been changed in
    process_org() method
    Replaced 'return nil if org.blank? && !allow' by
    'return hash if org.blank? && !allow' where 'hash remove_org_selection_params(params_in: hash)'
  • RSpec test spec/controllers/contributors_controller_spec.rb method
    'it "with restrict_orgs=true, returns nil if the org could not be
    converted" do'
    replaced by
    'it "with restrict_orgs=true, returns hash if the org could not be
    converted" do'

Based on @briri comment https://github.com/DigitalCurationCentre/DMPonline-Service/issues/649
I had to remove org from hash. Also combining the returns in process_org() defied my efforts so have

`
hash = remove_org_selection_params(params_in: hash)

return hash if org.blank? && !allow
return hash unless org.present?

`

@johnpinto1 johnpinto1 force-pushed the bug_dcc_649-contributors_page_affiliation_not_set_prevents_save branch 3 times, most recently from 3bbb59a to 708e477 Compare November 3, 2021 11:40
page if not required Affiliation field not set.

Changes:
 - In ContributorsController an if condition has been changed in
process_org() method
Replaced  'return nil if org.blank? && !allow' by
 'return hash if org.blank? && !allow' where 'hash remove_org_selection_params(params_in: hash)'
- RSpec test  spec/controllers/contributors_controller_spec.rb method
     'it "with restrict_orgs=true, returns nil if the org could not be
converted" do'
replaced by
'it "with restrict_orgs=true, returns hash if the org could not be
converted" do'
@johnpinto1 johnpinto1 force-pushed the bug_dcc_649-contributors_page_affiliation_not_set_prevents_save branch from 708e477 to 6f30ff1 Compare November 3, 2021 11:41
Copy link
Contributor

@briri briri left a comment

Choose a reason for hiding this comment

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

looks good John. Thanks!

@briri briri merged commit 43c5b03 into development Nov 3, 2021
@briri briri deleted the bug_dcc_649-contributors_page_affiliation_not_set_prevents_save branch June 15, 2022 19: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.

3 participants