From 96e0815eedaa93bceaab176b50271ee8742aba8a Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Mon, 18 Aug 2014 16:29:42 +0100 Subject: Use different flash for fully_destroy external InfoRequest Uses a different flash message to avoid trying to fetch a non existent user record --- app/controllers/admin_request_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/controllers/admin_request_controller.rb') diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb index 5c45a6e6e..8a5f1bd14 100644 --- a/app/controllers/admin_request_controller.rb +++ b/app/controllers/admin_request_controller.rb @@ -100,7 +100,8 @@ class AdminRequestController < AdminController @info_request.fully_destroy # expire cached files expire_for_request(@info_request) - flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + user.email + email = user.try(:email) ? user.email : 'This request is external so has no associated user' + flash[:notice] = "Request #{url_title} has been completely destroyed. Email of user who made request: " + email redirect_to admin_request_list_url end -- cgit v1.2.3