Skip to content

Commit

Permalink
[webui] readd a creator function for requests
Browse files Browse the repository at this point in the history
  • Loading branch information
coolo committed Nov 8, 2012
1 parent bc08898 commit 67cb4e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/webui/app/controllers/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def changerequest
else
target = find_cached(Project, tprj)
end
target.add_person(:userid => BsRequest.creator(@req).login, :role => "maintainer")
target.add_person(:userid => @req.creator, :role => "maintainer")
target.save
end
end
Expand Down
6 changes: 6 additions & 0 deletions src/webui/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,4 +202,10 @@ def reviewer_for_history_item(item)
end
return reviewer
end

# return the login of the creator - to be obsoleted soon (FIXME2.4)
def creator
details = ApiDetails.find(:request_show, id: self.id)
return details['creator']
end
end
2 changes: 1 addition & 1 deletion src/webui/app/views/shared/_requests_small.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<td style="border: medium none; padding: 0px;">
<%= link_to("##{req.value(:id)}", :controller => :request, :action => :show, :id => req.value(:id)) -%>
by
<%= render :partial => 'shared/user_with_realname_and_icon', :locals => {:user => BsRequest.creator(req).login, :short => true}%>
<%= render :partial => 'shared/user_with_realname_and_icon', :locals => {:user => req.creator, :short => true}%>
(<%= fuzzy_time_string(req.state.value :when) %>)
</td>
</tr>
Expand Down

0 comments on commit 67cb4e7

Please sign in to comment.