aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_request_controller.rb
diff options
context:
space:
mode:
authorGareth Rees <gareth@mysociety.org>2014-08-18 16:29:42 +0100
committerGareth Rees <gareth@mysociety.org>2014-08-18 16:29:42 +0100
commit96e0815eedaa93bceaab176b50271ee8742aba8a (patch)
tree8efe4ddf81a7f5eb1aeab172e7f456ccadfed00c /app/controllers/admin_request_controller.rb
parenta4d343096231d62e8d91a1b23ba9e1997e9136c0 (diff)
Use different flash for fully_destroy external InfoRequest
Uses a different flash message to avoid trying to fetch a non existent user record
Diffstat (limited to 'app/controllers/admin_request_controller.rb')
-rw-r--r--app/controllers/admin_request_controller.rb3
1 files changed, 2 insertions, 1 deletions
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