Skip to content

Commit

Permalink
Merge pull request #3 from rauversion/event-payments
Browse files Browse the repository at this point in the history
redirect on non activated account
  • Loading branch information
michelson committed Aug 25, 2023
2 parents 1990f69 + 4fe2876 commit 56bf393
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/tracks_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class TracksController < ApplicationController
before_action :authenticate_user!, except: [:index, :show, :private_access]

before_action :check_activated_account, only: [:new, :create, :update, :delete]
def index
@tracks = Track.published.order("id desc")
.with_attached_cover
Expand Down Expand Up @@ -114,6 +114,10 @@ def track_params
)
end

def check_activated_account
redirect_to( root_path, notice: t("not_activated_account")) and return unless current_user.is_creator?
end

def track_bulk_params
params.require(:track_bulk_creator).permit(
:make_playlist, :private,
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ en:
sure: Are you sure?
more: More
save: Save
not_activated_account: Access denied, not activated account.

menu:
music: Music
Expand Down

0 comments on commit 56bf393

Please sign in to comment.