Commit 762c7b4f2b272f56d185f09f061a8811c751a50e
1 parent
0f055197
Exists in
spb-stable
and in
3 other branches
Fixed 500 error when creating issue for project with no commits.
The form was updated to check that the repository wasn't empty before trying to load the contribution guide. This fixes #153.
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/views/projects/issues/_form.html.haml
1 | %div.issue-form-holder | 1 | %div.issue-form-holder |
2 | %h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}" | 2 | %h3.page-title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.iid}" |
3 | %hr | 3 | %hr |
4 | - - if @repository.contribution_guide && !@issue.persisted? | 4 | + - if !@repository.empty? && @repository.contribution_guide && !@issue.persisted? |
5 | - contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name)) | 5 | - contribution_guide_url = project_blob_path(@project, tree_join(@repository.root_ref, @repository.contribution_guide.name)) |
6 | .alert.alert-info.col-sm-10.col-sm-offset-2 | 6 | .alert.alert-info.col-sm-10.col-sm-offset-2 |
7 | ="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe | 7 | ="Please review the <strong>#{link_to "guidelines for contribution", contribution_guide_url}</strong> to this repository.".html_safe |