15954: Allow activating user using an admin token.
authorTom Clegg <tom@tomclegg.ca>
Tue, 25 Feb 2020 16:12:58 +0000 (11:12 -0500)
committerTom Clegg <tom@tomclegg.ca>
Tue, 25 Feb 2020 16:12:58 +0000 (11:12 -0500)
This was intended to work already, but didn't.

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

services/api/app/controllers/arvados/v1/users_controller.rb

index 1cf3b9d78a6e9d6290e9df1886304ba7124638c5..224f2c0bd464ceb182c4bc0a696a823def99393e 100644 (file)
@@ -45,8 +45,11 @@ class Arvados::V1::UsersController < ApplicationController
   end
 
   def activate
+    if params[:id] and params[:id].match(/\D/)
+      params[:uuid] = params.delete :id
+    end
     if current_user.andand.is_admin && params[:uuid]
-      @object = User.find params[:uuid]
+      @object = User.find_by_uuid params[:uuid]
     else
       @object = current_user
     end