changeset 3275:f239029b9f7e beta

protect against empty branch on edit file
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 30 Jan 2013 22:10:07 +0100
parents 567207469e95
children eaa887c6c0af
files rhodecode/templates/files/files_source.html
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/templates/files/files_source.html	Wed Jan 30 22:08:28 2013 +0100
+++ b/rhodecode/templates/files/files_source.html	Wed Jan 30 22:10:07 2013 +0100
@@ -25,7 +25,7 @@
               ${h.link_to(_('show as raw'),h.url('files_raw_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
               ${h.link_to(_('download as raw'),h.url('files_rawfile_home',repo_name=c.repo_name,revision=c.file_changeset.raw_id,f_path=c.f_path),class_="ui-btn")}
               % if h.HasRepoPermissionAny('repository.write','repository.admin')(c.repo_name):
-               % if c.on_branch_head and c.file.is_binary is False:
+               % if c.on_branch_head and c.changeset.branch and c.file.is_binary is False:
                 ${h.link_to(_('edit on branch:%s' % c.changeset.branch),h.url('files_edit_home',repo_name=c.repo_name,revision=c.changeset.branch,f_path=c.f_path),class_="ui-btn")}
                %else:
                 ${h.link_to(_('edit on branch:?'), '#', class_="ui-btn disabled tooltip", title=_('Editing files allowed only when on branch head revision'))}