Accomodate otherwise valid user-supplied portable data hashes with no size
[arvados.git] / services / api / app / models / job.rb
index fc445ae24edb5977a2092f7d92af86c300eb21ad..f56b57ac7b42361a216d05f93b07278fea7e1479 100644 (file)
@@ -40,6 +40,8 @@ class Job < ArvadosModel
     t.add :repository
     t.add :supplied_script_version
     t.add :docker_image_locator
+    t.add :name
+    t.add :description
   end
 
   def assert_finished
@@ -118,7 +120,7 @@ class Job < ArvadosModel
       self.docker_image_locator = nil
       true
     elsif coll = Collection.for_latest_docker_image(image_search, image_tag)
-      self.docker_image_locator = coll.uuid
+      self.docker_image_locator = coll.portable_data_hash
       true
     else
       errors.add(:docker_image_locator, "not found for #{image_search}")
@@ -191,7 +193,7 @@ class Job < ArvadosModel
       if self.cancelled_at and not self.cancelled_at_was
         self.cancelled_at = Time.now
         self.cancelled_by_user_uuid = current_user.uuid
-        self.cancelled_by_client_uuid = current_api_client.uuid
+        self.cancelled_by_client_uuid = current_api_client.andand.uuid
         @need_crunch_dispatch_trigger = true
       else
         self.cancelled_at = self.cancelled_at_was