X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/cc5023d40182e503e8ba109fc86e09efd6337836..3ac9fd0c91fe202a59e7c3611156bb1a9b8118fe:/services/api/app/controllers/arvados/v1/users_controller.rb diff --git a/services/api/app/controllers/arvados/v1/users_controller.rb b/services/api/app/controllers/arvados/v1/users_controller.rb index de067ce015..c2a32f02f1 100644 --- a/services/api/app/controllers/arvados/v1/users_controller.rb +++ b/services/api/app/controllers/arvados/v1/users_controller.rb @@ -74,7 +74,7 @@ class Arvados::V1::UsersController < ApplicationController head_uuid: required_uuids). collect(&:head_uuid) todo_uuids = required_uuids - signed_uuids - if todo_uuids == [] + if todo_uuids.empty? @object.update_attributes is_active: true logger.info "User #{@object.uuid} activated" else @@ -130,6 +130,11 @@ class Arvados::V1::UsersController < ApplicationController params[:repo_name], params[:vm_uuid] end + # setup succeeded. send email to user + if params[:send_notification_email] == true || params[:send_notification_email] == 'true' + UserNotifier.account_is_setup(@object).deliver + end + render json: { kind: "arvados#HashList", items: @response.as_api_response(nil) } end @@ -140,4 +145,12 @@ class Arvados::V1::UsersController < ApplicationController show end + protected + + def self._setup_requires_parameters + { + send_notification_email: { type: 'boolean', required: true }, + } + end + end