404 error for not authorized user #35

Open
nashby opened this Issue Oct 2, 2011 · 1 comment

Comments

Projects
None yet
3 participants
Member

nashby commented Oct 2, 2011

Given not authorized user
Given open contest
When I visit http://codebrawl.com/contests/command-line-todo-lists/entries/new
I should not see 404 error

I think it's because of this line (entries_controller.rb):

@contest.not_found if @contest.has_entry_from?(current_user)

so if current_user == nil this method fails (contest.rb):

def has_entry_from?(user)
  entries.where(:user_id => user.id).any?
end
Contributor

jeffkreeftmeijer commented Oct 3, 2011

Yes, we probably need a 401 there. :)

lenary was assigned Oct 9, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment