Changeset - 95923493de9a
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2012-09-28 15:57:57
marcin@python-works.com
protect agains pull requests on empty repositories
1 file changed with 8 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/pullrequests.py
Show inline comments
 
@@ -50,6 +50,7 @@ from rhodecode.model.repo import RepoMod
 
from rhodecode.model.comment import ChangesetCommentsModel
 
from rhodecode.model.changeset_status import ChangesetStatusModel
 
from rhodecode.model.forms import PullRequestForm
 
from rhodecode.lib.vcs.exceptions import EmptyRepositoryError
 

	
 
log = logging.getLogger(__name__)
 

	
 
@@ -107,6 +108,13 @@ class PullrequestsController(BaseRepoCon
 
            log.error('Review not available for GIT REPOS')
 
            raise HTTPNotFound
 

	
 
        try:
 
            org_repo.scm_instance.get_changeset()
 
        except EmptyRepositoryError, e:
 
            h.flash(h.literal(_('There are no changesets yet')),
 
                    category='warning')
 
            redirect(url('summary_home', repo_name=org_repo.repo_name))
 

	
 
        other_repos_info = {}
 

	
 
        c.org_refs = self._get_repo_refs(c.rhodecode_repo)
0 comments (0 inline, 0 general)