Fix handling of `attrs[:managed]` + Refactor `OrgsController#admin_update` by aaronskiba · Pull Request #3529 · DMPRoadmap/roadmap
changed the title
Fix handling of
Fix handling of attrs[:managed] on Org updatesattrs[:managed] + Refactor OrgsController#admin_update
This change resolves issue DMPRoadmap#3528 by preventing the updating of `@org.managed` when `attrs[:managed]` is missing. Prior to this change, the `if attrs.key?(:managed)` was not present. But it was necessary, because that key is not present when a super user clicks "Save" on the "Request Feedback" page. - As a result, if `attrs[:managed]` was not present, then `attrs[:managed] = (attrs[:managed] == '1')` would evaluate false, and `if @org.update(attrs)` (line 81) would subsequently update `@org.managed` to false in the db.
This refactor is meant to serve as a small step in simplifying `OrgsController#admin_update` controller action, which currently contains a lot of rubocop offences. - Moved `attrs[:logo]` handling logic into `handle_logo(attrs)` - Moved Shibboleth identifier handling into `handle_shibboleth_identifier(attrs)`
aaronskiba
changed the base branch from
main
to
next-release/v5.0.3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters