3036: Assign collection uuid without complaint if not provided by client.
[arvados.git] / services / api / app / controllers / arvados / v1 / collections_controller.rb
index 97f004ec4faf876cc1f1298ee49803fb3b601173..a0c64aa6e6adc4ad30dc4094681a45d3ce597ecb 100644 (file)
@@ -63,11 +63,11 @@ class Arvados::V1::CollectionsController < ApplicationController
         @object.save!
       rescue ActiveRecord::RecordNotUnique
         logger.debug resource_attrs.inspect
-        if resource_attrs[:manifest_text] and resource_attrs[:uuid]
+        if @object.manifest_text and @object.uuid
           @existing_object = model_class.
             where('uuid=? and manifest_text=?',
-                  resource_attrs[:uuid],
-                  resource_attrs[:manifest_text]).
+                  @object.uuid,
+                  @object.manifest_text).
             first
           @object = @existing_object || @object
         end