hasadna / alaveteli

Provide a Freedom of Information request system for your jurisdiction
http://www.askdata.org.il/
Other
2 stars 1 forks source link

Viewing some requests results in an error #16

Open yauzi opened 10 years ago

yauzi commented 10 years ago

http://askdata.org.il/admin/request/show/113

Error:

RuntimeError in Admin_request#show

Showing app/views/admin_request/show.rhtml where line #42 raised:

internal error, last_event_forming_initial_request gets nil for request 113 outgoing messages count 1 all events: --- []

Extracted source (around line #42):

39:                   <% end %>
40:                   <% if column_name == 'described_state' %>
41:                     <ul>
42:                       <li><strong>Initial request last sent at:</strong> <%= @info_request.calculate_status %></li>
43:                       <li><strong>Initial request last sent at:</strong> <%=@info_request.date_initial_request_last_sent_at.to_date %></li>
44:                       <li><strong>Date response required by:</strong> <%= @info_request.date_response_required_by %></li>
45:                       <li><strong>Very overdue after:</strong> <%= @info_request.date_very_overdue_after %></li>

RAILS_ROOT: /home/alaveteli/alaveteli
Application Trace | Framework Trace | Full Trace

/home/alaveteli/alaveteli/app/models/info_request.rb:693:in `last_event_forming_initial_request'
/home/alaveteli/alaveteli/app/models/info_request.rb:714:in `date_very_overdue_after'
/home/alaveteli/alaveteli/app/models/info_request.rb:615:in `base_calculate_status'
/home/alaveteli/alaveteli/app/models/info_request.rb:607:in `calculate_status'
/home/alaveteli/alaveteli/app/views/admin_request/show.rhtml:42:in `_run_rhtml_app47views47admin_request47show46rhtml'
/home/alaveteli/alaveteli/app/models/info_request.rb:1134:in `for_admin_column'
/home/alaveteli/alaveteli/app/models/info_request.rb:1133:in `each'
/home/alaveteli/alaveteli/app/models/info_request.rb:1133:in `for_admin_column'
/home/alaveteli/alaveteli/app/views/admin_request/show.rhtml:28:in `_run_rhtml_app47views47admin_request47show46rhtml'
/home/alaveteli/alaveteli/app/views/admin_request/show.rhtml:5:in `_run_rhtml_app47views47admin_request47show46rhtml'
/home/alaveteli/alaveteli/app/controllers/application_controller.rb:105:in `record_memory'

Request

Parameters:

{"id"=>"113"}

Show session dump
Response

Headers:

{"Vary"=>"Cookie",
 "Content-Type"=>"",
 "Cache-Control"=>"no-cache"}
crowbot commented 10 years ago

The problem here is that the request has never been sent to the authority (presumably because it was created before outgoing email was correctly configured. In a live install of alaveteli, that would indicate a serious problem, so an error is raised. It could be resolved by deleting the request (presuming that it's test data), or by sending the message using OutgoingMessage.send_message from the console.