aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/controllers/request_controller.rb10
-rw-r--r--app/models/info_request.rb12
2 files changed, 11 insertions, 11 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 42693f867..d8f8db3cf 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -417,12 +417,22 @@ class RequestController < ApplicationController
end
# Make the state change
+ event = info_request.log_event("status_update",
+ { :user_id => authenticated_user.id,
+ :old_described_state => info_request.described_state,
+ :described_state => described_state,
+ })
+
info_request.set_described_state(described_state, authenticated_user, message)
# If you're not the *actual* requester. e.g. you are playing the
# classification game, or you're doing this just because you are an
# admin user (not because you also own the request).
if !info_request.is_actual_owning_user?(authenticated_user)
+ # Create a classification event for league tables
+ RequestClassification.create!(:user_id => authenticated_user.id,
+ :info_request_event_id => event.id)
+
# Don't give advice on what to do next, as it isn't their request
if session[:request_game]
flash[:notice] = _('Thank you for updating the status of the request \'<a href="{{url}}">{{info_request_title}}</a>\'. There are some more requests below for you to classify.',:info_request_title=>CGI.escapeHTML(info_request.title), :url=>CGI.escapeHTML(request_path(info_request)))
diff --git a/app/models/info_request.rb b/app/models/info_request.rb
index 46c247fa9..8f15a4ea4 100644
--- a/app/models/info_request.rb
+++ b/app/models/info_request.rb
@@ -584,16 +584,6 @@ public
end
unless set_by.nil? || is_actual_owning_user?(set_by) || described_state == 'attention_requested'
- # Log the status change by someone other than the requester
- event = log_event("status_update",
- { :user_id => set_by.id,
- :old_described_state => old_described_state,
- :described_state => described_state,
- })
- # Create a classification event for league tables
- RequestClassification.create!(:user_id => set_by.id,
- :info_request_event_id => event.id)
-
RequestMailer.old_unclassified_updated(self).deliver if !is_external?
end
end
@@ -646,7 +636,7 @@ public
event.save!
end
curr_state = nil
- elsif !curr_state.nil? && (event.event_type == 'followup_sent' || event.event_type == 'sent') && !event.described_state.nil? && (event.described_state == 'waiting_response' || event.described_state == 'internal_review')
+ elsif !curr_state.nil? && (event.event_type == 'followup_sent' || event.event_type == 'sent' || event.event_type == "status_update")
# Followups can set the status to waiting response / internal
# review. Initial requests ('sent') set the status to waiting response.