Merge remote-tracking branch 'origin/master' into 2044-share-button
[arvados.git] / services / api / lib / has_uuid.rb
index d9c819889f543f1acbc3ccfafc5a370137efb970..3bd330edca59808bd3fbbe21f49725c687e5e7c7 100644 (file)
@@ -28,7 +28,10 @@ module HasUuid
 
   def assign_uuid
     return true if !self.respond_to_uuid?
-    return true if uuid and current_user and current_user.is_admin
+    if (uuid.is_a?(String) and uuid.length>0 and
+        current_user and current_user.is_admin)
+      return true
+    end
     self.uuid = self.class.generate_uuid
   end