aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/public_body_controller.rb3
-rw-r--r--app/controllers/request_controller.rb8
-rw-r--r--app/controllers/user_controller.rb12
3 files changed, 18 insertions, 5 deletions
diff --git a/app/controllers/public_body_controller.rb b/app/controllers/public_body_controller.rb
index 2e540d198..cc3d0b64a 100644
--- a/app/controllers/public_body_controller.rb
+++ b/app/controllers/public_body_controller.rb
@@ -58,6 +58,9 @@ class PublicBodyController < ApplicationController
flash.keep(:search_params)
@track_thing = TrackThing.create_track_for_public_body(@public_body)
+ if @user
+ @existing_track = TrackThing.find_existing(@user, @track_thing)
+ end
@feed_autodetect = [ { :url => do_track_url(@track_thing, 'feed'), :title => @track_thing.params[:title_in_rss], :has_json => true } ]
respond_to do |format|
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb
index 081c14d7f..e847cae1e 100644
--- a/app/controllers/request_controller.rb
+++ b/app/controllers/request_controller.rb
@@ -16,11 +16,9 @@ class RequestController < ApplicationController
@@custom_states_loaded = false
begin
- if !Rails.env.test?
- require 'customstates'
- include RequestControllerCustomStates
- @@custom_states_loaded = true
- end
+ require 'customstates'
+ include RequestControllerCustomStates
+ @@custom_states_loaded = true
rescue MissingSourceFile, NameError
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index 56f42891d..d66b4aa8e 100644
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -460,6 +460,12 @@ class UserController < ApplicationController
return
end
if !params[:submitted_draft_profile_photo].nil?
+ if @user.banned?
+ flash[:error]= _('Banned users cannot edit their profile')
+ redirect_to set_profile_photo_path
+ return
+ end
+
# check for uploaded image
file_name = nil
file_content = nil
@@ -569,6 +575,12 @@ class UserController < ApplicationController
return
end
+ if @user.banned?
+ flash[:error] = _('Banned users cannot edit their profile')
+ redirect_to set_profile_about_me_path
+ return
+ end
+
@about_me = AboutMeValidator.new(params[:about_me])
if !@about_me.valid?
render :action => 'set_profile_about_me'