aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-12-14 04:19:12 +0100
committerMarcin Kuzminski <marcin@python-works.com>2012-12-14 04:19:12 +0100
commitcd0bb95f053a518ef22020834143bf55a8037327 (patch)
treea3ad28d48e9ad18efbe633a03039bee15a15c79d
parenteaa7d9c66882232abf981d1a8b8b7d92164bd340 (diff)
- #683 fixed difference between messages about not mapped repositories
--HG-- branch : beta
-rwxr-xr-xdocs/changelog.rst1
-rw-r--r--rhodecode/controllers/admin/repos.py14
-rw-r--r--rhodecode/controllers/forks.py14
-rw-r--r--rhodecode/controllers/settings.py14
-rw-r--r--rhodecode/lib/helpers.py7
5 files changed, 14 insertions, 36 deletions
diff --git a/docs/changelog.rst b/docs/changelog.rst
index c4beb78e..cfc46f7c 100755
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -32,6 +32,7 @@ fixes
- default permissions can get duplicated after migration
- fixed changeset status labels, they now select radio buttons
- #682 translation difficult for multi-line text
+- #683 fixed difference between messages about not mapped repositories
1.5.0 (**2012-12-12**)
----------------------
diff --git a/rhodecode/controllers/admin/repos.py b/rhodecode/controllers/admin/repos.py
index 8124042c..ff9efd1a 100644
--- a/rhodecode/controllers/admin/repos.py
+++ b/rhodecode/controllers/admin/repos.py
@@ -89,12 +89,7 @@ class ReposController(BaseController):
repo = db_repo.scm_instance
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')
-
+ h.not_mapped_error(repo_name)
return redirect(url('repos'))
##override defaults for exact repo info here git/hg etc
@@ -310,12 +305,7 @@ class ReposController(BaseController):
repo_model = RepoModel()
repo = repo_model.get_by_repo_name(repo_name)
if not repo:
- h.flash(_('%s repository is not mapped to db perhaps'
- ' it was moved or renamed from the filesystem'
- ' please run the application again'
- ' in order to rescan repositories') % repo_name,
- category='error')
-
+ h.not_mapped_error(repo_name)
return redirect(url('repos'))
try:
action_logger(self.rhodecode_user, 'admin_deleted_repo',
diff --git a/rhodecode/controllers/forks.py b/rhodecode/controllers/forks.py
index b08a7b71..d5c56a8a 100644
--- a/rhodecode/controllers/forks.py
+++ b/rhodecode/controllers/forks.py
@@ -71,12 +71,7 @@ class ForksController(BaseRepoController):
repo = db_repo.scm_instance
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')
-
+ h.not_mapped_error(repo_name)
return redirect(url('repos'))
c.default_user_id = User.get_by_username('default').user_id
@@ -131,12 +126,7 @@ class ForksController(BaseRepoController):
def fork(self, repo_name):
c.repo_info = Repository.get_by_repo_name(repo_name)
if not c.repo_info:
- h.flash(_('%s repository is not mapped to db perhaps'
- ' it was created or renamed from the file system'
- ' please run the application again'
- ' in order to rescan repositories') % repo_name,
- category='error')
-
+ h.not_mapped_error(repo_name)
return redirect(url('home'))
defaults = self.__load_data(repo_name)
diff --git a/rhodecode/controllers/settings.py b/rhodecode/controllers/settings.py
index 6d8d1f08..3e850481 100644
--- a/rhodecode/controllers/settings.py
+++ b/rhodecode/controllers/settings.py
@@ -77,12 +77,7 @@ class SettingsController(BaseRepoController):
repo = db_repo.scm_instance
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')
-
+ h.not_mapped_error(repo_name)
return redirect(url('home'))
##override defaults for exact repo info here git/hg etc
@@ -157,12 +152,7 @@ class SettingsController(BaseRepoController):
repo_model = RepoModel()
repo = repo_model.get_by_repo_name(repo_name)
if not repo:
- h.flash(_('%s repository is not mapped to db perhaps'
- ' it was moved or renamed from the filesystem'
- ' please run the application again'
- ' in order to rescan repositories') % repo_name,
- category='error')
-
+ h.not_mapped_error(repo_name)
return redirect(url('home'))
try:
action_logger(self.rhodecode_user, 'user_deleted_repo',
diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py
index 656c2e14..a4a210c4 100644
--- a/rhodecode/lib/helpers.py
+++ b/rhodecode/lib/helpers.py
@@ -1157,3 +1157,10 @@ def journal_filter_help():
"repository:vcs OR repository:test"
"username:test AND repository:test*"
'''))
+
+
+def not_mapped_error(repo_name):
+ 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')