# HG changeset patch # User Bradley M. Kuhn # Date 1404342310 14400 # Node ID d208416c84c6ff5efdd5b0e79ed2bcc96697c458 # Parent 06e49be38d786b50f95dcc803b0f4fd640ebffde Rename rhodecode_user to authuser - it is an AuthUser instance diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/gists.py --- a/kallithea/controllers/admin/gists.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/gists.py Wed Jul 02 19:05:10 2014 -0400 @@ -69,7 +69,7 @@ def index(self): """GET /admin/gists: All items in the collection""" # url('gists') - not_default_user = c.rhodecode_user.username != User.DEFAULT_USER + not_default_user = c.authuser.username != User.DEFAULT_USER c.show_private = request.GET.get('private') and not_default_user c.show_public = request.GET.get('public') and not_default_user @@ -80,17 +80,17 @@ # MY private if c.show_private and not c.show_public: gists = gists.filter(Gist.gist_type == Gist.GIST_PRIVATE)\ - .filter(Gist.gist_owner == c.rhodecode_user.user_id) + .filter(Gist.gist_owner == c.authuser.user_id) # MY public elif c.show_public and not c.show_private: gists = gists.filter(Gist.gist_type == Gist.GIST_PUBLIC)\ - .filter(Gist.gist_owner == c.rhodecode_user.user_id) + .filter(Gist.gist_owner == c.authuser.user_id) # MY public+private elif c.show_private and c.show_public: gists = gists.filter(or_(Gist.gist_type == Gist.GIST_PUBLIC, Gist.gist_type == Gist.GIST_PRIVATE))\ - .filter(Gist.gist_owner == c.rhodecode_user.user_id) + .filter(Gist.gist_owner == c.authuser.user_id) # default show ALL public gists if not c.show_public and not c.show_private: @@ -122,7 +122,7 @@ gist_type = Gist.GIST_PUBLIC if _public else Gist.GIST_PRIVATE gist = GistModel().create( description=form_result['description'], - owner=c.rhodecode_user.user_id, + owner=c.authuser.user_id, gist_mapping=nodes, gist_type=gist_type, lifetime=form_result['lifetime'] @@ -176,7 +176,7 @@ # method='delete') # url('gist', gist_id=ID) gist = GistModel().get_gist(gist_id) - owner = gist.gist_owner == c.rhodecode_user.user_id + owner = gist.gist_owner == c.authuser.user_id if h.HasPermissionAny('hg.admin')() or owner: GistModel().delete(gist) Session().commit() diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/my_account.py --- a/kallithea/controllers/admin/my_account.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/my_account.py Wed Jul 02 19:05:10 2014 -0400 @@ -63,7 +63,7 @@ super(MyAccountController, self).__before__() def __load_data(self): - c.user = User.get(self.rhodecode_user.user_id) + c.user = User.get(self.authuser.user_id) if c.user.username == User.DEFAULT_USER: h.flash(_("You can't edit this user since it's" " crucial for entire application"), category='warning') @@ -75,12 +75,12 @@ repos_list = [x.follows_repository for x in Session().query(UserFollowing).filter( UserFollowing.user_id == - self.rhodecode_user.user_id).all()] + self.authuser.user_id).all()] else: admin = True repos_list = Session().query(Repository)\ .filter(Repository.user_id == - self.rhodecode_user.user_id)\ + self.authuser.user_id)\ .order_by(func.lower(Repository.repo_name)).all() repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list, @@ -95,7 +95,7 @@ # url('my_account') c.active = 'profile' self.__load_data() - c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id, + c.perm_user = AuthUser(user_id=self.authuser.user_id, ip_addr=self.ip_addr) c.extern_type = c.user.extern_type c.extern_name = c.user.extern_name @@ -104,8 +104,8 @@ update = False if request.POST: _form = UserForm(edit=True, - old_data={'user_id': self.rhodecode_user.user_id, - 'email': self.rhodecode_user.email})() + old_data={'user_id': self.authuser.user_id, + 'email': self.authuser.email})() form_result = {} try: post_data = dict(request.POST) @@ -120,7 +120,7 @@ # forbid updating username for external accounts skip_attrs.append('username') - UserModel().update(self.rhodecode_user.user_id, form_result, + UserModel().update(self.authuser.user_id, form_result, skip_attrs=skip_attrs) h.flash(_('Your account was updated successfully'), category='success') @@ -151,10 +151,10 @@ c.active = 'password' self.__load_data() if request.POST: - _form = PasswordChangeForm(self.rhodecode_user.username)() + _form = PasswordChangeForm(self.authuser.username)() try: form_result = _form.to_python(request.POST) - UserModel().update(self.rhodecode_user.user_id, form_result) + UserModel().update(self.authuser.user_id, form_result) Session().commit() h.flash(_("Successfully updated password"), category='success') except formencode.Invalid as errors: @@ -189,7 +189,7 @@ def my_account_perms(self): c.active = 'perms' self.__load_data() - c.perm_user = AuthUser(user_id=self.rhodecode_user.user_id, + c.perm_user = AuthUser(user_id=self.authuser.user_id, ip_addr=self.ip_addr) return render('admin/my_account/my_account.html') @@ -206,7 +206,7 @@ email = request.POST.get('new_email') try: - UserModel().add_extra_email(self.rhodecode_user.user_id, email) + UserModel().add_extra_email(self.authuser.user_id, email) Session().commit() h.flash(_("Added email %s to user") % email, category='success') except formencode.Invalid, error: @@ -221,7 +221,7 @@ def my_account_emails_delete(self): email_id = request.POST.get('del_email_id') user_model = UserModel() - user_model.delete_extra_email(self.rhodecode_user.user_id, email_id) + user_model.delete_extra_email(self.authuser.user_id, email_id) Session().commit() h.flash(_("Removed email from user"), category='success') return redirect(url('my_account_emails')) @@ -239,11 +239,11 @@ c.my_pull_requests = _filter(PullRequest.query()\ .filter(PullRequest.user_id == - self.rhodecode_user.user_id)\ + self.authuser.user_id)\ .all()) my_prs = [x.pull_request for x in PullRequestReviewers.query() .filter(PullRequestReviewers.user_id == - self.rhodecode_user.user_id).all()] + self.authuser.user_id).all()] c.participate_in_pull_requests = _filter(my_prs) return render('admin/my_account/my_account.html') @@ -259,14 +259,14 @@ (str(60 * 24 * 30), _('1 month')), ] c.lifetime_options = [(c.lifetime_values, _("Lifetime"))] - c.user_api_keys = ApiKeyModel().get_api_keys(self.rhodecode_user.user_id, + c.user_api_keys = ApiKeyModel().get_api_keys(self.authuser.user_id, show_expired=show_expired) return render('admin/my_account/my_account.html') def my_account_api_keys_add(self): lifetime = safe_int(request.POST.get('lifetime'), -1) description = request.POST.get('description') - new_api_key = ApiKeyModel().create(self.rhodecode_user.user_id, + new_api_key = ApiKeyModel().create(self.authuser.user_id, description, lifetime) Session().commit() h.flash(_("Api key successfully created"), category='success') @@ -274,7 +274,7 @@ def my_account_api_keys_delete(self): api_key = request.POST.get('del_api_key') - user_id = self.rhodecode_user.user_id + user_id = self.authuser.user_id if request.POST.get('del_api_key_builtin'): user = User.get(user_id) if user: @@ -283,7 +283,7 @@ Session().commit() h.flash(_("Api key successfully reset"), category='success') elif api_key: - ApiKeyModel().delete(api_key, self.rhodecode_user.user_id) + ApiKeyModel().delete(api_key, self.authuser.user_id) Session().commit() h.flash(_("Api key successfully deleted"), category='success') diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/notifications.py --- a/kallithea/controllers/admin/notifications.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/notifications.py Wed Jul 02 19:05:10 2014 -0400 @@ -59,8 +59,8 @@ def index(self, format='html'): """GET /_admin/notifications: All items in the collection""" # url('notifications') - c.user = self.rhodecode_user - notif = NotificationModel().get_for_user(self.rhodecode_user.user_id, + c.user = self.authuser + notif = NotificationModel().get_for_user(self.authuser.user_id, filter_=request.GET.getall('type')) p = safe_int(request.GET.get('page', 1), 1) @@ -82,11 +82,11 @@ if request.environ.get('HTTP_X_PARTIAL_XHR'): nm = NotificationModel() # mark all read - nm.mark_all_read_for_user(self.rhodecode_user.user_id, + nm.mark_all_read_for_user(self.authuser.user_id, filter_=request.GET.getall('type')) Session().commit() - c.user = self.rhodecode_user - notif = nm.get_for_user(self.rhodecode_user.user_id, + c.user = self.authuser + notif = nm.get_for_user(self.authuser.user_id, filter_=request.GET.getall('type')) c.notifications = Page(notif, page=1, items_per_page=10) return render('admin/notifications/notifications_data.html') @@ -109,11 +109,11 @@ # url('notification', notification_id=ID) try: no = Notification.get(notification_id) - owner = all(un.user.user_id == c.rhodecode_user.user_id + owner = all(un.user.user_id == c.authuser.user_id for un in no.notifications_to_users) if h.HasPermissionAny('hg.admin')() or owner: # deletes only notification2user - NotificationModel().mark_read(c.rhodecode_user.user_id, no) + NotificationModel().mark_read(c.authuser.user_id, no) Session().commit() return 'ok' except Exception: @@ -131,11 +131,11 @@ # url('notification', notification_id=ID) try: no = Notification.get(notification_id) - owner = any(un.user.user_id == c.rhodecode_user.user_id + owner = any(un.user.user_id == c.authuser.user_id for un in no.notifications_to_users) if h.HasPermissionAny('hg.admin')() or owner: # deletes only notification2user - NotificationModel().delete(c.rhodecode_user.user_id, no) + NotificationModel().delete(c.authuser.user_id, no) Session().commit() return 'ok' except Exception: @@ -146,10 +146,10 @@ def show(self, notification_id, format='html'): """GET /_admin/notifications/id: Show a specific item""" # url('notification', notification_id=ID) - c.user = self.rhodecode_user + c.user = self.authuser no = Notification.get(notification_id) - owner = any(un.user.user_id == c.rhodecode_user.user_id + owner = any(un.user.user_id == c.authuser.user_id for un in no.notifications_to_users) repo_admin = h.HasRepoPermissionAny('repository.admin') if no and (h.HasPermissionAny('hg.admin')() or repo_admin or owner): diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/repo_groups.py --- a/kallithea/controllers/admin/repo_groups.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/repo_groups.py Wed Jul 02 19:05:10 2014 -0400 @@ -106,9 +106,9 @@ return data def _revoke_perms_on_yourself(self, form_result): - _up = filter(lambda u: c.rhodecode_user.username == u[0], + _up = filter(lambda u: c.authuser.username == u[0], form_result['perms_updates']) - _new = filter(lambda u: c.rhodecode_user.username == u[0], + _new = filter(lambda u: c.authuser.username == u[0], form_result['perms_new']) if _new and _new[0][1] != 'group.admin' or _up and _up[0][1] != 'group.admin': return True @@ -177,7 +177,7 @@ group_name=form_result['group_name'], group_description=form_result['group_description'], parent=form_result['group_parent_id'], - owner=self.rhodecode_user.user_id, + owner=self.authuser.user_id, copy_permissions=form_result['group_copy_permissions'] ) Session().commit() @@ -412,7 +412,7 @@ c.repo_group = RepoGroupModel()._get_repo_group(group_name) valid_recursive_choices = ['none', 'repos', 'groups', 'all'] form_result = RepoGroupPermsForm(valid_recursive_choices)().to_python(request.POST) - if not c.rhodecode_user.is_admin: + if not c.authuser.is_admin: if self._revoke_perms_on_yourself(form_result): msg = _('Cannot revoke permission for yourself as admin') h.flash(msg, category='warning') @@ -426,7 +426,7 @@ form_result['perms_updates'], recursive) #TODO: implement this - #action_logger(self.rhodecode_user, 'admin_changed_repo_permissions', + #action_logger(self.authuser, 'admin_changed_repo_permissions', # repo_name, self.ip_addr, self.sa) Session().commit() h.flash(_('Repository Group permissions updated'), category='success') @@ -447,8 +447,8 @@ elif obj_type == 'user_group': obj_id = safe_int(request.POST.get('user_group_id')) - if not c.rhodecode_user.is_admin: - if obj_type == 'user' and c.rhodecode_user.user_id == obj_id: + if not c.authuser.is_admin: + if obj_type == 'user' and c.authuser.user_id == obj_id: msg = _('Cannot revoke permission for yourself as admin') h.flash(msg, category='warning') raise Exception('revoke admin permission on self') diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/repos.py --- a/kallithea/controllers/admin/repos.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/repos.py Wed Jul 02 19:05:10 2014 -0400 @@ -143,7 +143,7 @@ # create is done sometimes async on celery, db transaction # management is handled there. - task = RepoModel().create(form_result, self.rhodecode_user.user_id) + task = RepoModel().create(form_result, self.authuser.user_id) from celery.result import BaseAsyncResult if isinstance(task, BaseAsyncResult): task_id = task.task_id @@ -287,7 +287,7 @@ h.flash(_('Repository %s updated successfully') % repo_name, category='success') changed_name = repo.repo_name - action_logger(self.rhodecode_user, 'admin_updated_repo', + action_logger(self.authuser, 'admin_updated_repo', changed_name, self.ip_addr, self.sa) Session().commit() except formencode.Invalid, errors: @@ -334,7 +334,7 @@ handle_forks = 'delete' h.flash(_('Deleted %s forks') % _forks, category='success') repo_model.delete(repo, forks=handle_forks) - action_logger(self.rhodecode_user, 'admin_deleted_repo', + action_logger(self.authuser, 'admin_deleted_repo', repo_name, self.ip_addr, self.sa) ScmModel().mark_for_invalidation(repo_name) h.flash(_('Deleted repository %s') % repo_name, category='success') @@ -394,7 +394,7 @@ RepoModel()._update_permissions(repo_name, form['perms_new'], form['perms_updates']) #TODO: implement this - #action_logger(self.rhodecode_user, 'admin_changed_repo_permissions', + #action_logger(self.authuser, 'admin_changed_repo_permissions', # repo_name, self.ip_addr, self.sa) Session().commit() h.flash(_('Repository permissions updated'), category='success') @@ -416,7 +416,7 @@ repo=repo_name, group_name=obj_id ) #TODO: implement this - #action_logger(self.rhodecode_user, 'admin_revoked_repo_permissions', + #action_logger(self.authuser, 'admin_revoked_repo_permissions', # repo_name, self.ip_addr, self.sa) Session().commit() except Exception: @@ -540,7 +540,7 @@ try: fork_id = request.POST.get('id_fork_of') repo = ScmModel().mark_as_fork(repo_name, fork_id, - self.rhodecode_user.username) + self.authuser.username) fork = repo.fork.repo_name if repo.fork else _('Nothing') Session().commit() h.flash(_('Marked repo %s as fork of %s') % (repo_name, fork), @@ -565,7 +565,7 @@ try: repo = Repository.get_by_repo_name(repo_name) if request.POST.get('set_lock'): - Repository.lock(repo, c.rhodecode_user.user_id) + Repository.lock(repo, c.authuser.user_id) h.flash(_('Locked repository'), category='success') elif request.POST.get('set_unlock'): Repository.unlock(repo) @@ -592,7 +592,7 @@ Repository.unlock(repo) action = _('Unlocked') else: - Repository.lock(repo, c.rhodecode_user.user_id) + Repository.lock(repo, c.authuser.user_id) action = _('Locked') h.flash(_('Repository has been %s') % action, @@ -631,7 +631,7 @@ c.active = 'remote' if request.POST: try: - ScmModel().pull_changes(repo_name, self.rhodecode_user.username) + ScmModel().pull_changes(repo_name, self.authuser.username) h.flash(_('Pulled from remote location'), category='success') except Exception, e: log.error(traceback.format_exc()) diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/user_groups.py --- a/kallithea/controllers/admin/user_groups.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/user_groups.py Wed Jul 02 19:05:10 2014 -0400 @@ -138,11 +138,11 @@ form_result = users_group_form.to_python(dict(request.POST)) UserGroupModel().create(name=form_result['users_group_name'], description=form_result['user_group_description'], - owner=self.rhodecode_user.user_id, + owner=self.authuser.user_id, active=form_result['users_group_active']) gr = form_result['users_group_name'] - action_logger(self.rhodecode_user, + action_logger(self.authuser, 'admin_created_users_group:%s' % gr, None, self.ip_addr, self.sa) h.flash(_('Created user group %s') % gr, category='success') @@ -191,7 +191,7 @@ form_result = users_group_form.to_python(request.POST) UserGroupModel().update(c.user_group, form_result) gr = form_result['users_group_name'] - action_logger(self.rhodecode_user, + action_logger(self.authuser, 'admin_updated_users_group:%s' % gr, None, self.ip_addr, self.sa) h.flash(_('Updated user group %s') % gr, category='success') @@ -309,7 +309,7 @@ h.flash(_('Target group cannot be the same'), category='error') return redirect(url('edit_user_group_perms', id=id)) #TODO: implement this - #action_logger(self.rhodecode_user, 'admin_changed_repo_permissions', + #action_logger(self.authuser, 'admin_changed_repo_permissions', # repo_name, self.ip_addr, self.sa) Session().commit() h.flash(_('User Group permissions updated'), category='success') @@ -330,8 +330,8 @@ elif obj_type == 'user_group': obj_id = safe_int(request.POST.get('user_group_id')) - if not c.rhodecode_user.is_admin: - if obj_type == 'user' and c.rhodecode_user.user_id == obj_id: + if not c.authuser.is_admin: + if obj_type == 'user' and c.authuser.user_id == obj_id: msg = _('Cannot revoke permission for yourself as admin') h.flash(msg, category='warning') raise Exception('revoke admin permission on self') diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/admin/users.py --- a/kallithea/controllers/admin/users.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/admin/users.py Wed Jul 02 19:05:10 2014 -0400 @@ -128,7 +128,7 @@ form_result = user_form.to_python(dict(request.POST)) user_model.create(form_result) usr = form_result['username'] - action_logger(self.rhodecode_user, 'admin_created_user:%s' % usr, + action_logger(self.authuser, 'admin_created_user:%s' % usr, None, self.ip_addr, self.sa) h.flash(_('Created user %s') % usr, category='success') @@ -181,7 +181,7 @@ user_model.update(id, form_result, skip_attrs=skip_attrs) usr = form_result['username'] - action_logger(self.rhodecode_user, 'admin_updated_user:%s' % usr, + action_logger(self.authuser, 'admin_updated_user:%s' % usr, None, self.ip_addr, self.sa) h.flash(_('User updated successfully'), category='success') Session().commit() diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/api/__init__.py --- a/kallithea/controllers/api/__init__.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/api/__init__.py Wed Jul 02 19:05:10 2014 -0400 @@ -189,8 +189,8 @@ # this is little trick to inject logged in user for # perms decorators to work they expect the controller class to have - # rhodecode_user attribute set - self.rhodecode_user = auth_u + # authuser attribute set + self.authuser = auth_u # This attribute will need to be first param of a method that uses # api_key, which is translated to instance of user at that name diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/api/api.py --- a/kallithea/controllers/api/api.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/api/api.py Wed Jul 02 19:05:10 2014 -0400 @@ -196,7 +196,7 @@ try: ScmModel().pull_changes(repo.repo_name, - self.rhodecode_user.username) + self.authuser.username) return dict( msg='Pulled from `%s`' % repo.repo_name, repository=repo.repo_name diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/changeset.py Wed Jul 02 19:05:10 2014 -0400 @@ -356,7 +356,7 @@ c.co = comm = ChangesetCommentsModel().create( text=text, repo=c.db_repo.repo_id, - user=c.rhodecode_user.user_id, + user=c.authuser.user_id, revision=revision, f_path=request.POST.get('f_path'), line_no=request.POST.get('line'), @@ -374,7 +374,7 @@ ChangesetStatusModel().set_status( c.db_repo.repo_id, status, - c.rhodecode_user.user_id, + c.authuser.user_id, comm, revision=revision, dont_allow_on_closed_pull_request=True @@ -386,7 +386,7 @@ h.flash(msg, category='warning') return redirect(h.url('changeset_home', repo_name=repo_name, revision=revision)) - action_logger(self.rhodecode_user, + action_logger(self.authuser, 'user_commented_revision:%s' % revision, c.db_repo, self.ip_addr, self.sa) @@ -425,7 +425,7 @@ @jsonify def delete_comment(self, repo_name, comment_id): co = ChangesetComment.get(comment_id) - owner = co.author.user_id == c.rhodecode_user.user_id + owner = co.author.user_id == c.authuser.user_id repo_admin = h.HasRepoPermissionAny('repository.admin') if h.HasPermissionAny('hg.admin')() or repo_admin or owner: ChangesetCommentsModel().delete(comment=co) diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/files.py --- a/kallithea/controllers/files.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/files.py Wed Jul 02 19:05:10 2014 -0400 @@ -322,7 +322,7 @@ c.default_message = _('Deleted file %s via RhodeCode') % (f_path) c.f_path = f_path node_path = f_path - author = self.rhodecode_user.full_contact + author = self.authuser.full_contact if r_post: message = r_post.get('message') or c.default_message @@ -334,7 +334,7 @@ } } self.scm_model.delete_nodes( - user=c.rhodecode_user.user_id, repo=c.db_repo, + user=c.authuser.user_id, repo=c.db_repo, message=message, nodes=nodes, parent_cs=c.cs, @@ -395,7 +395,7 @@ content = convert_line_endings(r_post.get('content', ''), mode) message = r_post.get('message') or c.default_message - author = self.rhodecode_user.full_contact + author = self.authuser.full_contact if content == old_content: h.flash(_('No changes'), category='warning') @@ -404,7 +404,7 @@ try: self.scm_model.commit_change(repo=c.db_repo_scm_instance, repo_name=repo_name, cs=c.cs, - user=self.rhodecode_user.user_id, + user=self.authuser.user_id, author=author, message=message, content=content, f_path=f_path) h.flash(_('Successfully committed to %s') % f_path, @@ -466,7 +466,7 @@ #strip all crap out of file, just leave the basename filename = os.path.basename(filename) node_path = os.path.join(location, filename) - author = self.rhodecode_user.full_contact + author = self.authuser.full_contact try: nodes = { @@ -475,7 +475,7 @@ } } self.scm_model.create_nodes( - user=c.rhodecode_user.user_id, repo=c.db_repo, + user=c.authuser.user_id, repo=c.db_repo, message=message, nodes=nodes, parent_cs=c.cs, @@ -586,7 +586,7 @@ break yield data # store download action - action_logger(user=c.rhodecode_user, + action_logger(user=c.authuser, action='user_downloaded_archive:%s' % (archive_name), repo=repo_name, ipaddr=self.ip_addr, commit=True) response.content_disposition = str('attachment; filename=%s' % (archive_name)) diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/forks.py --- a/kallithea/controllers/forks.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/forks.py Wed Jul 02 19:05:10 2014 -0400 @@ -172,7 +172,7 @@ # create fork is done sometimes async on celery, db transaction # management is handled there. - task = RepoModel().create_fork(form_result, self.rhodecode_user.user_id) + task = RepoModel().create_fork(form_result, self.authuser.user_id) from celery.result import BaseAsyncResult if isinstance(task, BaseAsyncResult): task_id = task.task_id diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/journal.py --- a/kallithea/controllers/journal.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/journal.py Wed Jul 02 19:05:10 2014 -0400 @@ -196,9 +196,9 @@ def index(self): # Return a rendered template p = safe_int(request.GET.get('page', 1), 1) - c.user = User.get(self.rhodecode_user.user_id) + c.user = User.get(self.authuser.user_id) c.following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() @@ -216,7 +216,7 @@ repos_list = Session().query(Repository)\ .filter(Repository.user_id == - self.rhodecode_user.user_id)\ + self.authuser.user_id)\ .order_by(func.lower(Repository.repo_name)).all() repos_data = RepoModel().get_repos_as_dict(repos_list=repos_list, @@ -288,7 +288,7 @@ Produce an atom-1.0 feed via feedgenerator module """ following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() return self._atom_feed(following, public=False) @@ -300,7 +300,7 @@ Produce an rss feed via feedgenerator module """ following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() return self._rss_feed(following, public=False) @@ -316,7 +316,7 @@ if user_id: try: self.scm_model.toggle_following_user(user_id, - self.rhodecode_user.user_id) + self.authuser.user_id) Session.commit() return 'ok' except Exception: @@ -326,7 +326,7 @@ if repo_id: try: self.scm_model.toggle_following_repo(repo_id, - self.rhodecode_user.user_id) + self.authuser.user_id) Session.commit() return 'ok' except Exception: @@ -341,7 +341,7 @@ p = safe_int(request.GET.get('page', 1), 1) c.following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() @@ -362,7 +362,7 @@ Produce an atom-1.0 feed via feedgenerator module """ c.following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() @@ -374,7 +374,7 @@ Produce an rss2 feed via feedgenerator module """ c.following = self.sa.query(UserFollowing)\ - .filter(UserFollowing.user_id == self.rhodecode_user.user_id)\ + .filter(UserFollowing.user_id == self.authuser.user_id)\ .options(joinedload(UserFollowing.follows_repository))\ .all() diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/login.py --- a/kallithea/controllers/login.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/login.py Wed Jul 02 19:05:10 2014 -0400 @@ -59,7 +59,7 @@ auth_user = AuthUser(user.user_id) auth_user.set_authenticated() cs = auth_user.get_cookie_store() - session['rhodecode_user'] = cs + session['authuser'] = cs user.update_lastlogin() Session().commit() @@ -105,11 +105,11 @@ came_from = self._validate_came_from(request.GET.get('came_from')) c.came_from = came_from or _default_came_from - not_default = self.rhodecode_user.username != User.DEFAULT_USER - ip_allowed = self.rhodecode_user.ip_allowed + not_default = self.authuser.username != User.DEFAULT_USER + ip_allowed = self.authuser.ip_allowed # redirect if already logged in - if self.rhodecode_user.is_authenticated and not_default and ip_allowed: + if self.authuser.is_authenticated and not_default and ip_allowed: raise HTTPFound(location=c.came_from) if request.POST: diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/pullrequests.py --- a/kallithea/controllers/pullrequests.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/pullrequests.py Wed Jul 02 19:05:10 2014 -0400 @@ -161,10 +161,10 @@ return [g for g in groups if g[0]], selected def _get_is_allowed_change_status(self, pull_request): - owner = self.rhodecode_user.user_id == pull_request.user_id - reviewer = self.rhodecode_user.user_id in [x.user_id for x in + owner = self.authuser.user_id == pull_request.user_id + reviewer = self.authuser.user_id in [x.user_id for x in pull_request.reviewers] - return self.rhodecode_user.admin or owner or reviewer + return self.authuser.admin or owner or reviewer def _load_compare_data(self, pull_request, enable_comments=True): """ @@ -345,7 +345,7 @@ description = _form['pullrequest_desc'] try: pull_request = PullRequestModel().create( - self.rhodecode_user.user_id, org_repo, org_ref, other_repo, + self.authuser.user_id, org_repo, org_ref, other_repo, other_ref, revisions, reviewers, title, description ) Session().commit() @@ -370,7 +370,7 @@ if pull_request.is_closed(): raise HTTPForbidden() #only owner or admin can update it - owner = pull_request.author.user_id == c.rhodecode_user.user_id + owner = pull_request.author.user_id == c.authuser.user_id repo_admin = h.HasRepoPermissionAny('repository.admin')(c.repo_name) if h.HasPermissionAny('hg.admin') or repo_admin or owner: reviewers_ids = map(int, filter(lambda v: v not in [None, ''], @@ -389,7 +389,7 @@ def delete(self, repo_name, pull_request_id): pull_request = PullRequest.get_or_404(pull_request_id) #only owner can delete it ! - if pull_request.author.user_id == c.rhodecode_user.user_id: + if pull_request.author.user_id == c.authuser.user_id: PullRequestModel().delete(pull_request) Session().commit() h.flash(_('Successfully deleted pull request'), @@ -485,7 +485,7 @@ comm = ChangesetCommentsModel().create( text=text, repo=c.db_repo.repo_id, - user=c.rhodecode_user.user_id, + user=c.authuser.user_id, pull_request=pull_request_id, f_path=request.POST.get('f_path'), line_no=request.POST.get('line'), @@ -495,7 +495,7 @@ closing_pr=close_pr ) - action_logger(self.rhodecode_user, + action_logger(self.authuser, 'user_commented_pull_request:%s' % pull_request_id, c.db_repo, self.ip_addr, self.sa) @@ -505,7 +505,7 @@ ChangesetStatusModel().set_status( c.db_repo.repo_id, status, - c.rhodecode_user.user_id, + c.authuser.user_id, comm, pull_request=pull_request_id ) @@ -513,7 +513,7 @@ if close_pr: if status in ['rejected', 'approved']: PullRequestModel().close_pull_request(pull_request_id) - action_logger(self.rhodecode_user, + action_logger(self.authuser, 'user_closed_pull_request:%s' % pull_request_id, c.db_repo, self.ip_addr, self.sa) else: @@ -549,7 +549,7 @@ #don't allow deleting comments on closed pull request raise HTTPForbidden() - owner = co.author.user_id == c.rhodecode_user.user_id + owner = co.author.user_id == c.authuser.user_id repo_admin = h.HasRepoPermissionAny('repository.admin')(c.repo_name) if h.HasPermissionAny('hg.admin') or repo_admin or owner: ChangesetCommentsModel().delete(comment=co) diff -r 06e49be38d78 -r d208416c84c6 kallithea/controllers/summary.py --- a/kallithea/controllers/summary.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/controllers/summary.py Wed Jul 02 19:05:10 2014 -0400 @@ -136,8 +136,8 @@ _load_changelog_summary() username = '' - if self.rhodecode_user.username != User.DEFAULT_USER: - username = safe_str(self.rhodecode_user.username) + if self.authuser.username != User.DEFAULT_USER: + username = safe_str(self.authuser.username) _def_clone_uri = _def_clone_uri_by_id = c.clone_uri_tmpl if '{repo}' in _def_clone_uri: diff -r 06e49be38d78 -r d208416c84c6 kallithea/lib/auth.py --- a/kallithea/lib/auth.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/lib/auth.py Wed Jul 02 19:05:10 2014 -0400 @@ -736,7 +736,7 @@ def __wrapper(self, func, *fargs, **fkwargs): cls = fargs[0] - user = cls.rhodecode_user + user = cls.authuser loc = "%s:%s" % (cls.__class__.__name__, func.__name__) # check if our IP is allowed @@ -794,7 +794,7 @@ def __wrapper(self, func, *fargs, **fkwargs): cls = fargs[0] - self.user = cls.rhodecode_user + self.user = cls.authuser log.debug('Checking if user is not anonymous @%s' % cls) @@ -824,7 +824,7 @@ def __wrapper(self, func, *fargs, **fkwargs): cls = fargs[0] - self.user = cls.rhodecode_user + self.user = cls.authuser self.user_perms = self.user.permissions log.debug('checking %s permissions %s for %s %s', self.__class__.__name__, self.required_perms, cls, self.user) diff -r 06e49be38d78 -r d208416c84c6 kallithea/lib/base.py --- a/kallithea/lib/base.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/lib/base.py Wed Jul 02 19:05:10 2014 -0400 @@ -314,7 +314,7 @@ c.repo_name = get_repo_slug(request) # can be empty c.backends = BACKENDS.keys() c.unread_notifications = NotificationModel()\ - .get_unread_cnt_for_user(c.rhodecode_user.user_id) + .get_unread_cnt_for_user(c.authuser.user_id) self.cut_off_limit = safe_int(config.get('cut_off_limit')) self.sa = meta.Session @@ -335,7 +335,7 @@ auth_user = AuthUser(api_key=api_key, ip_addr=self.ip_addr) authenticated = False else: - cookie_store = CookieStoreWrapper(session.get('rhodecode_user')) + cookie_store = CookieStoreWrapper(session.get('authuser')) try: auth_user = AuthUser(user_id=cookie_store.get('user_id', None), ip_addr=self.ip_addr) @@ -355,7 +355,7 @@ auth_user.set_authenticated(authenticated) request.user = auth_user #set globals for auth user - self.rhodecode_user = c.rhodecode_user = auth_user + self.authuser = c.authuser = auth_user log.info('IP: %s User: %s accessed %s' % ( self.ip_addr, auth_user, safe_unicode(_get_access_path(environ))) ) @@ -413,4 +413,4 @@ c.repository_forks = self.scm_model.get_forks(dbr) c.repository_pull_requests = self.scm_model.get_pull_requests(dbr) c.repository_following = self.scm_model.is_following_repo( - c.repo_name, self.rhodecode_user.user_id) + c.repo_name, self.authuser.user_id) diff -r 06e49be38d78 -r d208416c84c6 kallithea/lib/utils.py --- a/kallithea/lib/utils.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/lib/utils.py Wed Jul 02 19:05:10 2014 -0400 @@ -56,7 +56,7 @@ UserLog, RepoGroup, RhodeCodeSetting, CacheInvalidation, UserGroup from kallithea.model.meta import Session from kallithea.model.repo_group import RepoGroupModel -from kallithea.lib.utils2 import safe_str, safe_unicode, get_current_rhodecode_user +from kallithea.lib.utils2 import safe_str, safe_unicode, get_current_authuser from kallithea.lib.vcs.utils.fakemod import create_module from kallithea.model.user_group import UserGroupModel @@ -178,7 +178,7 @@ # if we don't get explicit IP address try to get one from registered user # in tmpl context var if not ipaddr: - ipaddr = getattr(get_current_rhodecode_user(), 'ip_addr', '') + ipaddr = getattr(get_current_authuser(), 'ip_addr', '') try: if getattr(user, 'user_id', None): diff -r 06e49be38d78 -r d208416c84c6 kallithea/lib/utils2.py --- a/kallithea/lib/utils2.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/lib/utils2.py Wed Jul 02 19:05:10 2014 -0400 @@ -671,14 +671,14 @@ return "".join(output)[:truncate_to] -def get_current_rhodecode_user(): +def get_current_authuser(): """ Gets rhodecode user from threadlocal tmpl_context variable if it's defined, else returns None. """ from pylons import tmpl_context - if hasattr(tmpl_context, 'rhodecode_user'): - return tmpl_context.rhodecode_user + if hasattr(tmpl_context, 'authuser'): + return tmpl_context.authuser return None diff -r 06e49be38d78 -r d208416c84c6 kallithea/model/repo.py --- a/kallithea/model/repo.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/model/repo.py Wed Jul 02 19:05:10 2014 -0400 @@ -35,7 +35,7 @@ from kallithea.lib.vcs.backends import get_backend from kallithea.lib.compat import json from kallithea.lib.utils2 import LazyProperty, safe_str, safe_unicode, \ - remove_prefix, obfuscate_url_pw, get_current_rhodecode_user + remove_prefix, obfuscate_url_pw, get_current_authuser from kallithea.lib.caching_query import FromCache from kallithea.lib.hooks import log_create_repository, log_delete_repository @@ -537,7 +537,7 @@ :param fs_remove: remove(archive) repo from filesystem """ if not cur_user: - cur_user = getattr(get_current_rhodecode_user(), 'username', None) + cur_user = getattr(get_current_authuser(), 'username', None) repo = self._get_repo(repo) if repo: if forks == 'detach': diff -r 06e49be38d78 -r d208416c84c6 kallithea/model/user.py --- a/kallithea/model/user.py Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/model/user.py Wed Jul 02 19:05:10 2014 -0400 @@ -32,7 +32,7 @@ from sqlalchemy.exc import DatabaseError -from kallithea.lib.utils2 import safe_unicode, generate_api_key, get_current_rhodecode_user +from kallithea.lib.utils2 import safe_unicode, generate_api_key, get_current_authuser from kallithea.lib.caching_query import FromCache from kallithea.model import BaseModel from kallithea.model.db import User, UserToPerm, Notification, \ @@ -78,7 +78,7 @@ def create(self, form_data, cur_user=None): if not cur_user: - cur_user = getattr(get_current_rhodecode_user(), 'username', None) + cur_user = getattr(get_current_authuser(), 'username', None) from kallithea.lib.hooks import log_create_user, check_allowed_create_user _fd = form_data @@ -127,7 +127,7 @@ :param cur_user: """ if not cur_user: - cur_user = getattr(get_current_rhodecode_user(), 'username', None) + cur_user = getattr(get_current_authuser(), 'username', None) from kallithea.lib.auth import get_crypt_password, check_password from kallithea.lib.hooks import log_create_user, check_allowed_create_user @@ -259,7 +259,7 @@ def delete(self, user, cur_user=None): if not cur_user: - cur_user = getattr(get_current_rhodecode_user(), 'username', None) + cur_user = getattr(get_current_authuser(), 'username', None) user = self._get_user(user) try: diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/gists/edit.html --- a/kallithea/templates/admin/gists/edit.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/gists/edit.html Wed Jul 02 19:05:10 2014 -0400 @@ -51,7 +51,7 @@ ${h.form(h.url('edit_gist', gist_id=c.gist.gist_access_id), method='post', id='eform')}
- gravatar + gravatar
diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/gists/show.html --- a/kallithea/templates/admin/gists/show.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/gists/show.html Wed Jul 02 19:05:10 2014 -0400 @@ -22,7 +22,7 @@
${self.breadcrumbs()} - %if c.rhodecode_user.username != 'default': + %if c.authuser.username != 'default':
- %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: + %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id:
${h.form(url('gist', gist_id=c.gist.gist_id),method='delete')} ${h.submit('remove_gist', _('Delete'),class_="btn btn-mini btn-danger",onclick="return confirm('"+_('Confirm to delete this Gist')+"');")} @@ -62,7 +62,7 @@ %endif
## only owner should see that - %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.rhodecode_user.user_id: + %if h.HasPermissionAny('hg.admin')() or c.gist.gist_owner == c.authuser.user_id: ${h.link_to(_('Edit'),h.url('edit_gist', gist_id=c.gist.gist_access_id),class_="btn btn-mini")} %endif ${h.link_to(_('Show as Raw'),h.url('formatted_gist', gist_id=c.gist.gist_access_id, format='raw'),class_="btn btn-mini")} diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/my_account/my_account.html --- a/kallithea/templates/admin/my_account/my_account.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/my_account/my_account.html Wed Jul 02 19:05:10 2014 -0400 @@ -2,7 +2,7 @@ <%inherit file="/base/base.html"/> <%def name="title()"> - ${_('My account')} ${c.rhodecode_user.username} + ${_('My account')} ${c.authuser.username} %if c.rhodecode_name: · ${c.rhodecode_name} %endif diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/notifications/notifications.html --- a/kallithea/templates/admin/notifications/notifications.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/notifications/notifications.html Wed Jul 02 19:05:10 2014 -0400 @@ -2,7 +2,7 @@ <%inherit file="/base/base.html"/> <%def name="title()"> - ${_('My Notifications')} ${c.rhodecode_user.username} + ${_('My Notifications')} ${c.authuser.username} %if c.rhodecode_name: · ${c.rhodecode_name} %endif diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/notifications/show_notification.html --- a/kallithea/templates/admin/notifications/show_notification.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/notifications/show_notification.html Wed Jul 02 19:05:10 2014 -0400 @@ -2,7 +2,7 @@ <%inherit file="/base/base.html"/> <%def name="title()"> - ${_('Show notification')} ${c.rhodecode_user.username} + ${_('Show notification')} ${c.authuser.username} %if c.rhodecode_name: · ${c.rhodecode_name} %endif diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/repo_groups/repo_group_edit_perms.html --- a/kallithea/templates/admin/repo_groups/repo_group_edit_perms.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/repo_groups/repo_group_edit_perms.html Wed Jul 02 19:05:10 2014 -0400 @@ -15,7 +15,7 @@ %for r2p in c.repo_group.repo_group_to_perm: ##forbid revoking permission from yourself, except if you're an super admin - %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin: + %if c.authuser.user_id != r2p.user.user_id or c.authuser.is_admin: ${h.radio('u_perm_%s' % r2p.user.username,'group.none')} ${h.radio('u_perm_%s' % r2p.user.username,'group.read')} ${h.radio('u_perm_%s' % r2p.user.username,'group.write')} diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/repos/repo_add.html --- a/kallithea/templates/admin/repos/repo_add.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/repos/repo_add.html Wed Jul 02 19:05:10 2014 -0400 @@ -9,7 +9,7 @@ <%def name="breadcrumbs_links()"> - %if c.rhodecode_user.is_admin: + %if c.authuser.is_admin: ${h.link_to(_('Admin'),h.url('admin_home'))} » ${h.link_to(_('Repositories'),h.url('repos'))} diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/repos/repo_add_base.html --- a/kallithea/templates/admin/repos/repo_add_base.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/repos/repo_add_base.html Wed Jul 02 19:05:10 2014 -0400 @@ -13,7 +13,7 @@ - %if not c.rhodecode_user.is_admin: + %if not c.authuser.is_admin: ${h.hidden('user_created',True)} %endif
diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/user_groups/user_group_edit_perms.html --- a/kallithea/templates/admin/user_groups/user_group_edit_perms.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/user_groups/user_group_edit_perms.html Wed Jul 02 19:05:10 2014 -0400 @@ -15,7 +15,7 @@ %for r2p in c.user_group.user_user_group_to_perm: ##forbid revoking permission from yourself, except if you're an super admin - %if c.rhodecode_user.user_id != r2p.user.user_id or c.rhodecode_user.is_admin: + %if c.authuser.user_id != r2p.user.user_id or c.authuser.is_admin: ${h.radio('u_perm_%s' % r2p.user.username,'usergroup.none')} ${h.radio('u_perm_%s' % r2p.user.username,'usergroup.read')} ${h.radio('u_perm_%s' % r2p.user.username,'usergroup.write')} diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/admin/users/user_edit_profile.html --- a/kallithea/templates/admin/users/user_edit_profile.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/admin/users/user_edit_profile.html Wed Jul 02 19:05:10 2014 -0400 @@ -11,7 +11,7 @@ ${_('Avatars are disabled')}
${c.user.email or _('Missing email, please update this user email address.')} ##show current ip just if we show ourself - %if c.rhodecode_user.username == c.user.username: + %if c.authuser.username == c.user.username: [${_('current IP')}: ${c.perm_user.ip_addr or "?"}] %endif %endif diff -r 06e49be38d78 -r d208416c84c6 kallithea/templates/base/base.html --- a/kallithea/templates/base/base.html Wed Jul 02 19:05:00 2014 -0400 +++ b/kallithea/templates/base/base.html Wed Jul 02 19:05:10 2014 -0400 @@ -178,7 +178,7 @@ %endif ## TODO: this check feels wrong, it would be better to have a check for permissions ## also it feels like a job for the controller - %if c.rhodecode_user.username != 'default': + %if c.authuser.username != 'default':
  • ${_('Follow')} @@ -222,10 +222,10 @@
  • - avatar + avatar - %if c.rhodecode_user.username != 'default': - ${c.rhodecode_user.username} + %if c.authuser.username != 'default': + ${c.authuser.username} %if c.unread_notifications != 0: ${c.unread_notifications} %endif @@ -236,7 +236,7 @@
    - %if c.rhodecode_user.username == 'default': + %if c.authuser.username == 'default':

    ${_('Login to your account')}

    ${h.form(h.url('login_home',came_from=h.url.current()))}
    @@ -275,9 +275,9 @@ ${h.end_form()} %else: @@ -59,7 +59,7 @@ <%def name="comment_inline_form()">