# HG changeset patch # User Marcin Kuzminski # Date 1292010714 -3600 # Node ID 165a97509a15794989c2083e83cbc349f0a31272 # Parent e46d25e5921bd9682d74bfe241e61fdde188649b fixed small issue with caching, call to ScmModel().get needs to be before queries for new objects of Repository diff -r e46d25e5921b -r 165a97509a15 rhodecode/controllers/admin/repos.py --- a/rhodecode/controllers/admin/repos.py Fri Dec 10 19:46:50 2010 +0100 +++ b/rhodecode/controllers/admin/repos.py Fri Dec 10 20:51:54 2010 +0100 @@ -265,8 +265,17 @@ """GET /repos/repo_name/edit: Form to edit an existing item""" # url('edit_repo', repo_name=ID) repo_model = RepoModel() + r = ScmModel().get(repo_name) c.repo_info = repo_model.get_by_repo_name(repo_name) - r = ScmModel().get(repo_name) + + if c.repo_info is None: + 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') % repo_name, + category='error') + + return redirect(url('repos')) if c.repo_info.stats: last_rev = c.repo_info.stats.stat_on_revision @@ -282,15 +291,6 @@ c.stats_percentage = '%.2f' % ((float((last_rev)) / c.repo_last_rev) * 100) - if not c.repo_info: - 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') % repo_name, - category='error') - - return redirect(url('repos')) - defaults = c.repo_info.__dict__.copy() if c.repo_info.user: defaults.update({'user':c.repo_info.user.username})