Skip to content

Commit

Permalink
add error message on create impediment with wrong blocks id
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume DUPE committed Nov 5, 2019
1 parent 3d02b95 commit 60d2239
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/controllers/rb_impediments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ def create
begin
@impediment = RbTask.create_with_relationships(params, User.current.id, @project.id, true)
rescue => e
render :text => e.message.blank? ? e.to_s : e.message, :status => 400
Rails.logger.error(e.message.blank? ? e.to_s : e.message)
render :partial => "backlogs/model_errors", :object => { "base" => e.message.blank? ? e.to_s : e.message }, :status => 400
return
end

Expand Down
2 changes: 0 additions & 2 deletions app/models/rb_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ def self.create_with_relationships(params, user_id, project_id, is_impediment =

task.save!



task.move_before params[:next] unless is_impediment # impediments are not hosted under a single parent, so you can't tree-order them
task.update_blocked_list blocks.split(/\D+/) if is_impediment
task.time_entry_add(params)
Expand Down

0 comments on commit 60d2239

Please sign in to comment.