diff pylons_app/controllers/repos.py @ 140:b5e59e2b5cfe

moved cache invalidating to utils, as seperate function. Implemented invalidating in
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 09 May 2010 15:06:00 +0200
parents 20dc7a5eb748
children 988477a05db6
line wrap: on
line diff
--- a/pylons_app/controllers/repos.py	Sun May 09 14:53:52 2010 +0200
+++ b/pylons_app/controllers/repos.py	Sun May 09 15:06:00 2010 +0200
@@ -10,6 +10,7 @@
 from pylons_app.model.hg_model import HgModel
 from operator import itemgetter
 import shutil
+from pylons_app.lib.utils import invalidate_cache
 log = logging.getLogger(__name__)
 
 class ReposController(BaseController):
@@ -64,6 +65,10 @@
         log.info("Removing %s", rm_path)
         shutil.move(os.path.join(rm_path, '.hg'), os.path.join(rm_path, 'rm__.hg'))
         shutil.move(rm_path, os.path.join(path, 'rm__%s-%s' % (datetime.today(), id)))
+        
+        #clear our cached list for refresh with new repo
+        invalidate_cache('repo_list_2')
+                    
         return redirect(url('repos'))