# HG changeset patch # User Marcin Kuzminski # Date 1275863212 -7200 # Node ID 32d6c955218c1456fa687a8daf13e4a1d5084d24 # Parent 0e5455fda8fd1c3e8dc0b3510e480819f9445f89 added check for repo created outside of hg app diff -r 0e5455fda8fd -r 32d6c955218c pylons_app/controllers/repos.py --- a/pylons_app/controllers/repos.py Mon Jun 07 00:18:33 2010 +0200 +++ b/pylons_app/controllers/repos.py Mon Jun 07 00:26:52 2010 +0200 @@ -134,7 +134,8 @@ repo = repo_model.get(id) if not repo: h.flash(_('%s repository is not mapped to db perhaps' - ' it was moved or renamed please run the application again' + ' it was moved or renamed from the filesystem' + ' please run the application again' ' in order to rescan repositories') % id, category='error') return redirect(url('repos')) @@ -156,7 +157,14 @@ """GET /repos/id/edit: Form to edit an existing item""" # url('edit_repo', id=ID) repo_model = RepoModel() - c.repo_info = repo_model.get(id) + c.repo_info = repo = repo_model.get(id) + if not repo: + h.flash(_('%s repository is not mapped to db perhaps' + ' it was created or renamed from the filesystem' + ' please run the application again' + ' in order to rescan repositories') % id, category='error') + + return redirect(url('repos')) defaults = c.repo_info.__dict__ defaults.update({'user':c.repo_info.user.username}) return htmlfill.render(