Skip to content

Commit

Permalink
fix bugs in checking for valid theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmark committed Sep 3, 2019
1 parent 3623fb0 commit 2ec2469
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/autotune/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,13 @@ def handle_post!
end

if request.POST.key? 'theme'
@project.theme = Theme.find_by_slug request.POST['theme']
theme = Theme.find_by_slug request.POST['theme']
if theme.blank?
render_error("Can't find theme \"#{request.POST['theme']}\"", :bad_request)
return false
end

@project.theme = theme
@project.group = @project.theme.group

# is this user allowed to use this theme?
Expand Down

0 comments on commit 2ec2469

Please sign in to comment.