-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ADD] launching task arrays by selecting multiple files in New Boutiques #1298
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double check all his, I really am not sure it works.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
2c78795
to
bfc34f8
Compare
…ith new BTQ integrator
8e7b495
to
cad474a
Compare
@@ -522,21 +523,27 @@ def sanitize_param(input) | |||
# Make sure the file ID is valid, accessible, not already used and | |||
# of the correct type. | |||
when :file | |||
unless (Integer(value) rescue nil) | |||
if !(Integer(value) rescue nil) && !single_file_input? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why the fact we have a single file input is important when validating that a file's value is an integer? It shoudl always be validated, no?
I will need to review this carefully, just a read of the code is not enough for me to approve it. The changes are too complex and subtle. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this entire change set is wrong. The code modified here is mostly in the method sanitize_params(), which is a validation method, not a method supposed to actually perform behavioral actions like assigning input files. It's just supposed to verify them.
Please reconsider the whole thing, it's sanitize_params is not the right place to implement this feaure.
file = Userfile.find_accessible_by_user(value, self.user, :access_requested => file_access_symbol()) rescue nil | ||
unless file | ||
params_errors.add(invokename, ": cannot find userfile (ID #{value})") | ||
file_ids = value.blank? ? self.params[:interface_userfile_ids] : [value] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a list of userfile IDs [ 1, 2, 3 ]....
unless file | ||
params_errors.add(invokename, ": cannot find userfile (ID #{value})") | ||
file_ids = value.blank? ? self.params[:interface_userfile_ids] : [value] | ||
file_ids = Userfile.find_all_accessible_by_user( self.user, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And not this is a list of PAIRS, ids and names [ [ 1, 'hello' ], [ 2, 'bye' ] ]
Why is that variable still called file_ids
?
:access_requested => file_access_symbol | ||
).where(:id => file_ids).pluck(:id, :name) rescue nil | ||
|
||
if !file_ids.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about .empty?
Closed #1201