Skip to content

Commit

Permalink
[webui] Don't try to parse sourcediff for add_role or change_devel
Browse files Browse the repository at this point in the history
requests.
  • Loading branch information
saschpe committed Nov 10, 2011
1 parent 41133c2 commit 777720c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/webui/app/controllers/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ def show
diff_per_action = {}
# Parse each action and get the it's diff (per file)
result.each_with_index('/request/action') do |action_element, index|
parsed_sourcediff = {}
if action_element.value('type') == 'delete'
# Don't show bugs for delete requests, would be to many in the diff and doesn't make sense:
parsed_sourcediff = sorted_filenames_and_bugs_from_sourcediff(action_element.sourcediff, parse_bugs = false)
else
elsif ['submit', 'maintenance_release', 'maintenance_incident'].include?(action_element.value('type'))
parsed_sourcediff = sorted_filenames_and_bugs_from_sourcediff(action_element.sourcediff)
end
parsed_sourcediff[:action] = action_element;
Expand Down
2 changes: 1 addition & 1 deletion src/webui/app/views/request/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<% project, package, rev = diff[:action].source.project, "patchinfo", diff[:action].source.rev %>
<% when 'delete' %>
<% project, package, rev = diff[:action].target.project, diff[:action].target.package, diff[:action].target.rev %>
<% else %>
<% when 'submit', 'maintenance_release' %>
<% project, package, rev = diff[:action].source.project, diff[:action].source.package, diff[:action].source.rev %>
<% end %>
<%= render(:partial => 'shared/sourcediff', :locals => {:filenames => diff[:filenames], :files => diff[:files], :bugs => diff[:bugs], :source => {:project => project, :package => package, :rev => rev}, :css_id => "diff_action_#{index_and_type}", :css_class => "diff_action_display"}) %>
Expand Down

0 comments on commit 777720c

Please sign in to comment.