gitlabhq/gitlabhq — Issue #246: Error 500 when I try to edit a project as a non-admin
Author: flixflax
Created: 2011-12-28 11:00:26+00:00
State: open

I created a user that is no admin. Then I logged in as this user and created a new project.
After this I tried to edit it by clicking on 'Admin' in the left vertical menu -> Error 500

The log shows the following lines:

Started GET "/test3/edit" for xxxxxx at 2011-12-28 11:56:03 +0100
Processing by ProjectsController#edit as HTML
Parameters: {"id"=>"test3"}
Rendered projects/_form.html.haml (9.2ms)
Rendered projects/edit.html.erb within layouts/project (9.9ms)
Completed 500 Internal Server Error in 24ms

ActionView::Template::Error (/home/git/repositories/test3.git):
29: %cite.right= "http://#{GIT_HOST["host"]}/"
30: %td= f.text_field :code, :placeholder => "example"
31:
32: - unless @project.new_record? || @project.heads.empty?
33: %tr
34: %td= f.label :default_branch, "Default Branch"
35: %td= f.select(:default_branch, @project.heads.map(&:name), {}, :style => "width:300px;")
app/models/repository.rb:51:in `new'
app/models/repository.rb:51:in `repo'
app/models/repository.rb:85:in `heads'
app/models/project.rb:73:in `heads'
app/views/projects/_form.html.haml:32:in `block in _app_views_projects__form_html_haml___414915111_95768370'
app/views/projects/_form.html.haml:1:in `_app_views_projects__form_html_haml___414915111_95768370'
app/views/projects/edit.html.erb:1:in `_app_views_projects_edit_html_erb___313398202_95898980'