aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin_user_controller.rb4
-rw-r--r--app/views/admin_user/show.html.erb2
-rw-r--r--config/routes.rb3
3 files changed, 2 insertions, 7 deletions
diff --git a/app/controllers/admin_user_controller.rb b/app/controllers/admin_user_controller.rb
index 6031c816b..bbb5d002a 100644
--- a/app/controllers/admin_user_controller.rb
+++ b/app/controllers/admin_user_controller.rb
@@ -83,10 +83,6 @@ class AdminUserController < AdminController
def clear_profile_photo
@admin_user = User.find(params[:id])
- if !request.post?
- raise "Can only clear profile photo from POST request"
- end
-
if @admin_user.profile_photo
@admin_user.profile_photo.destroy
end
diff --git a/app/views/admin_user/show.html.erb b/app/views/admin_user/show.html.erb
index 3846bc173..1e7d885c5 100644
--- a/app/views/admin_user/show.html.erb
+++ b/app/views/admin_user/show.html.erb
@@ -4,7 +4,7 @@
<% if @admin_user.profile_photo %>
<div class="user_photo_on_admin">
- <%= form_tag admin_clear_profile_photo_path(@admin_user), :multipart => true, :class => "form" do %>
+ <%= form_tag clear_profile_photo_admin_user_path(@admin_user), :multipart => true, :class => "form" do %>
<img src="<%= get_profile_photo_url(:url_name => @admin_user.url_name) %>">
<br>
<%= submit_tag "Clear photo", :class => "btn btn-info" %>
diff --git a/config/routes.rb b/config/routes.rb
index 1db9f6c31..6704eb9fb 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -279,10 +279,9 @@ Alaveteli::Application.routes.draw do
post 'clear_bounce', :on => :member
post 'destroy_track', :on => :member
post 'login_as', :on => :member
-
+ post 'clear_profile_photo', :on => :member
end
end
- match '/admin/user/clear_profile_photo/:id' => 'admin_user#clear_profile_photo', :as => :admin_clear_profile_photo
match '/admin/user/modify_comment_visibility/:id' => 'admin_user#modify_comment_visibility', :as => 'admin_user_modify_comment_visibility'
####