diff --git a/pylons_app/config/environment.py b/pylons_app/config/environment.py --- a/pylons_app/config/environment.py +++ b/pylons_app/config/environment.py @@ -15,7 +15,7 @@ import pylons_app.lib.helpers log = logging.getLogger(__name__) -def load_environment(global_conf, app_conf): +def load_environment(global_conf, app_conf, initial=False): """Configure the Pylons environment via the ``pylons.config`` object """ @@ -63,7 +63,7 @@ def load_environment(global_conf, app_co init_model(sa_engine_db1) config['pylons.app_globals'].baseui = make_ui('db') - repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'])) + repo2db_mapper(_get_repos_cached_initial(config['pylons.app_globals'], initial)) set_available_permissions(config) set_base_path(config) set_hg_app_config(config) diff --git a/pylons_app/controllers/admin/repos.py b/pylons_app/controllers/admin/repos.py --- a/pylons_app/controllers/admin/repos.py +++ b/pylons_app/controllers/admin/repos.py @@ -16,6 +16,11 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. +""" +Created on April 7, 2010 +admin controller for pylons +@author: marcink +""" from formencode import htmlfill from operator import itemgetter from pylons import request, response, session, tmpl_context as c, url @@ -31,11 +36,8 @@ from pylons_app.model.repo_model import import formencode import logging import traceback -""" -Created on April 7, 2010 -admin controller for pylons -@author: marcink -""" +from paste.httpexceptions import HTTPInternalServerError + log = logging.getLogger(__name__) class ReposController(BaseController): @@ -130,7 +132,6 @@ class ReposController(BaseController): h.flash(_('error occured during update of repository %s') \ % repo_name, category='error') - return redirect(url('edit_repo', repo_name=changed_name)) def delete(self, repo_name): @@ -174,7 +175,7 @@ class ReposController(BaseController): except Exception as e: h.flash(_('An error occured during deletion of repository user'), category='error') - + raise HTTPInternalServerError() def show(self, repo_name, format='html'): """GET /repos/repo_name: Show a specific item""" diff --git a/pylons_app/controllers/summary.py b/pylons_app/controllers/summary.py --- a/pylons_app/controllers/summary.py +++ b/pylons_app/controllers/summary.py @@ -72,7 +72,6 @@ class SummaryController(BaseController): def __get_commit_stats(self, repo): aggregate = OrderedDict() - #graph range td = datetime.today() y = td.year @@ -80,23 +79,7 @@ class SummaryController(BaseController): d = td.day c.ts_min = mktime((y, (td - timedelta(days=calendar.mdays[m] - 1)).month, d, 0, 0, 0, 0, 0, 0,)) c.ts_max = mktime((y, m, d, 0, 0, 0, 0, 0, 0,)) - - -# #generate this monhts keys -# dates_range = OrderedDict() -# year_range = range(2010, datetime.today().year + 1) -# month_range = range(1, datetime.today().month + 1) -# -# -# -# for y in year_range: -# for m in month_range: -# for d in range(1, calendar.mdays[m] + 1): -# k = '%s-%s-%s' % (y, m, d) -# timetupple = [int(x) for x in k.split('-')] -# timetupple.extend([0 for _ in xrange(6)]) -# k = mktime(timetupple) -# dates_range[k] = 0 + def author_key_cleaner(k): k = person(k) diff --git a/pylons_app/websetup.py b/pylons_app/websetup.py --- a/pylons_app/websetup.py +++ b/pylons_app/websetup.py @@ -19,5 +19,5 @@ def setup_app(command, conf, vars): dbmanage.config_prompt() dbmanage.admin_prompt() dbmanage.create_permissions() - load_environment(conf.global_conf, conf.local_conf) + load_environment(conf.global_conf, conf.local_conf, initial=True)