[ARVADOS] updated: 1.1.3-79-g2adba06

Git user git at public.curoverse.com
Mon Feb 19 15:54:14 EST 2018


Summary of changes:
 services/api/app/models/collection.rb | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

       via  2adba06cd420ca3c9c274eedb5429dd1aa36d300 (commit)
      from  e4f37da149c9c1a07fc4670f4aaea49f751fcee9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 2adba06cd420ca3c9c274eedb5429dd1aa36d300
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Mon Feb 19 17:53:33 2018 -0300

    12707: Remove validations.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/api/app/models/collection.rb b/services/api/app/models/collection.rb
index 2fc5b5c..3146398 100644
--- a/services/api/app/models/collection.rb
+++ b/services/api/app/models/collection.rb
@@ -24,7 +24,6 @@ class Collection < ArvadosModel
   before_validation :check_signatures
   before_validation :strip_signatures_and_update_replication_confirmed
   validate :ensure_pdh_matches_manifest_text
-  validate :ensure_storage_classes_desired_is_not_empty
   before_save :set_file_names
 
   api_accessible :user, extend: :common do |t|
@@ -161,13 +160,6 @@ class Collection < ArvadosModel
     true
   end
 
-  def ensure_storage_classes_desired_is_not_empty
-    if storage_classes_desired.length == 0
-      errors.add(:storage_classes_desired, "shouldn't be empty")
-      false
-    end
-  end
-
   def ensure_pdh_matches_manifest_text
     if not manifest_text_changed? and not portable_data_hash_changed?
       true
@@ -485,13 +477,10 @@ class Collection < ArvadosModel
   end
 
   def ensure_permission_to_save
-    if (not current_user.andand.is_admin)
-      if (replication_confirmed_at_changed? or replication_confirmed_changed?) and
-        not (replication_confirmed_at.nil? and replication_confirmed.nil?)
-        raise ArvadosModel::PermissionDeniedError.new("replication_confirmed and replication_confirmed_at attributes cannot be changed, except by setting both to nil")
-      elsif (storage_classes_confirmed_changed? or storage_classes_confirmed_at_changed?) and not (storage_classes_confirmed == [] and storage_classes_confirmed_at.nil?)
-        raise ArvadosModel::PermissionDeniedError.new("storage_classes_confirmed and storage_classes_confirmed_at attributes cannot be changed, except by setting them to [] and nil respectively")
-      end
+    if (not current_user.andand.is_admin and
+      replication_confirmed_at_changed? or replication_confirmed_changed?) and
+      not (replication_confirmed_at.nil? and replication_confirmed.nil?))
+      raise ArvadosModel::PermissionDeniedError.new("replication_confirmed and replication_confirmed_at attributes cannot be changed, except by setting both to nil")
     end
     super
   end

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list