Mercurial > public > src > rhodecode
changeset 1190:f3f847712f87 beta
replaced all global calls to template context (rhodecode_user), into instance attributes
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 09 Mar 2011 20:26:02 +0100 |
parents | a8d759613d8f |
children | 31e82d872631 |
files | rhodecode/controllers/admin/repos.py rhodecode/controllers/admin/settings.py rhodecode/controllers/journal.py rhodecode/controllers/login.py rhodecode/controllers/settings.py rhodecode/controllers/summary.py |
diffstat | 6 files changed, 13 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/controllers/admin/repos.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/admin/repos.py Wed Mar 09 20:26:02 2011 +0100 @@ -158,7 +158,7 @@ form_result = {} try: form_result = RepoForm()(repo_groups=c.repo_groups).to_python(dict(request.POST)) - repo_model.create(form_result, c.rhodecode_user) + repo_model.create(form_result, self.rhodecode_user) if form_result['clone_uri']: h.flash(_('created repository %s from %s') \ % (form_result['repo_name'], form_result['clone_uri']), @@ -383,7 +383,7 @@ :param repo_name: """ try: - ScmModel().pull_changes(repo_name, c.rhodecode_user.username) + ScmModel().pull_changes(repo_name, self.rhodecode_user.username) h.flash(_('Pulled from remote location'), category='success') except Exception, e: h.flash(_('An error occurred during pull from remote location'),
--- a/rhodecode/controllers/admin/settings.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/admin/settings.py Wed Mar 09 20:26:02 2011 +0100 @@ -255,7 +255,7 @@ """ # url('admin_settings_my_account') - c.user = UserModel().get(c.rhodecode_user.user_id, cache=False) + c.user = UserModel().get(self.rhodecode_user.user_id, cache=False) all_repos = [r.repo_name for r in self.sa.query(Repository)\ .filter(Repository.user_id == c.user.user_id)\ .order_by(func.lower(Repository.repo_name)).all()] @@ -283,9 +283,9 @@ # method='put') # url('admin_settings_my_account_update', id=ID) user_model = UserModel() - uid = c.rhodecode_user.user_id + uid = self.rhodecode_user.user_id _form = UserForm(edit=True, old_data={'user_id':uid, - 'email':c.rhodecode_user.email})() + 'email':self.rhodecode_user.email})() form_result = {} try: form_result = _form.to_python(dict(request.POST)) @@ -294,8 +294,8 @@ category='success') except formencode.Invalid, errors: - c.user = user_model.get(c.rhodecode_user.user_id, cache=False) - c.user = UserModel().get(c.rhodecode_user.user_id, cache=False) + c.user = user_model.get(self.rhodecode_user.user_id, cache=False) + c.user = UserModel().get(self.rhodecode_user.user_id, cache=False) all_repos = self.sa.query(Repository)\ .filter(Repository.user_id == c.user.user_id)\ .order_by(func.lower(Repository.repo_name))\
--- a/rhodecode/controllers/journal.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/journal.py Wed Mar 09 20:26:02 2011 +0100 @@ -49,7 +49,7 @@ def __before__(self): super(JournalController, self).__before__() - c.rhodecode_user = self.rhodecode_user + self.rhodecode_user = self.rhodecode_user self.title = _('%s public journal %s feed') % (c.rhodecode_name, '%s') self.language = 'en-us' self.ttl = "5"
--- a/rhodecode/controllers/login.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/login.py Wed Mar 09 20:26:02 2011 +0100 @@ -52,8 +52,8 @@ #redirect if already logged in c.came_from = request.GET.get('came_from', None) - if c.rhodecode_user.is_authenticated \ - and c.rhodecode_user.username != 'default': + if self.rhodecode_user.is_authenticated \ + and self.rhodecode_user.username != 'default': return redirect(url('home'))
--- a/rhodecode/controllers/settings.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/settings.py Wed Mar 09 20:26:02 2011 +0100 @@ -189,7 +189,7 @@ try: form_result = _form.to_python(dict(request.POST)) form_result.update({'repo_name':repo_name}) - repo_model.create_fork(form_result, c.rhodecode_user) + repo_model.create_fork(form_result, self.rhodecode_user) h.flash(_('forked %s repository as %s') \ % (repo_name, form_result['fork_name']), category='success')
--- a/rhodecode/controllers/summary.py Wed Mar 09 19:47:52 2011 +0100 +++ b/rhodecode/controllers/summary.py Wed Mar 09 20:26:02 2011 +0100 @@ -65,7 +65,7 @@ c.dbrepo = dbrepo c.following = self.scm_model.is_following_repo(c.repo_name, - c.rhodecode_user.user_id) + self.rhodecode_user.user_id) def url_generator(**kw): return url('shortlog_home', repo_name=c.repo_name, **kw) @@ -79,7 +79,7 @@ username = '' password = '' else: - username = str(c.rhodecode_user.username) + username = str(self.rhodecode_user.username) password = '@' uri = u'%(protocol)s://%(user)s%(password)s%(host)s%(prefix)s/%(repo_name)s' % {