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

issues 327 and 354 Dragon Logo issues on update org #389

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

- Updated emails's language is based on user's choice on UI, instead of system default [196](https://github.com/portagenetwork/roadmap/issues/196)

- Issue with 500 page error resue on Logo isseus on update of Organizations [327](https://github.com/portagenetwork/roadmap/issues/327) and [354](https://github.com/portagenetwork/roadmap/issues/354)

## [3.1.0+portage-3.1.3] - 2023-06-13

Expand Down
30 changes: 17 additions & 13 deletions app/controllers/orgs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,25 @@ def admin_update

# Remove the extraneous Org Selector hidden fields
attrs = remove_org_selection_params(params_in: attrs)

if @org.update(attrs)
# Save any identifiers that were found
if current_user.can_super_admin? && lookup.present?
# Loop through the identifiers and then replace the existing
# identifier and save the new one
identifiers.each do |id|
@org = process_identifier_change(org: @org, identifier: id)
begin
if @org.update(attrs)
# Save any identifiers that were found
if current_user.can_super_admin? && lookup.present?
# Loop through the identifiers and then replace the existing
# identifier and save the new one
identifiers.each do |id|
@org = process_identifier_change(org: @org, identifier: id)
end
@org.save
end
@org.save
redirect_to "#{admin_edit_org_path(@org)}##{tab}",
notice: success_message(@org, _('saved'))
else
failure = failure_message(@org, _('save')) if failure.blank?
redirect_to "#{admin_edit_org_path(@org)}##{tab}", alert: failure
end
redirect_to "#{admin_edit_org_path(@org)}##{tab}",
notice: success_message(@org, _('saved'))
else
failure = failure_message(@org, _('save')) if failure.blank?
rescue Dragonfly::Job::Fetch::NotFound
failure = _('There seems to be a problem with your logo. Please upload it again.')
redirect_to "#{admin_edit_org_path(@org)}##{tab}", alert: failure
end
end
Expand Down