-
Notifications
You must be signed in to change notification settings - Fork 437
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
[webui] Refactor package save_file #1313
Conversation
redirect_to(:back, :error => 'Timeout when saving file. Please try again.') | ||
elsif file_url.present? | ||
# we have a remote file URI, so we have to download and save it | ||
@services = Service.find(project: @project, package: @package.name) |
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.
Use the proper method for that:
services = @package.services
I don't see the need of using instance variables here... use locals. They aren't sent to any view/template here
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.
Ok
11c7fad
to
bde6d4f
Compare
else | ||
redirect_to({:action => :show, :project => @project, :package => @package}, :success => "The file #{filename} has been added.") | ||
|
||
rescue APIException, StandardError => exception |
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.
With APIException & StandardError we can catch all possible exceptions (Suse::ValidationError is an APIException and ActiveXML::Transport::Error and Timeout::Error are StandardError etc.)
Please review! |
* A new file is an UploadedFile object which caused an Exception in Suse::Validator.validate because it called to_s on UploadedFile * Catches and shows now all Excepton * Some simplifications * Refactoring and improving of the tests This closes openSUSE#1253, closes openSUSE#1315
The submit button is disabled as long as not one of the fields is filled out.
bde6d4f
to
3d5a575
Compare
LGTM |
👍 |
[webui] Refactor package save_file
This will fix #1253