poc: adds AI user to the system, adds migration, changes AI settings to have switch enable\disable AI features

This commit is contained in:
ievgenii vdovenko 2025-09-01 12:51:26 +02:00
parent 60146345d3
commit b4aecb1e0b
24 changed files with 138 additions and 40 deletions

View file

@ -144,7 +144,7 @@ class BaseAppView(object):
if not user_obj:
return
if user_obj.username in [User.DEFAULT_USER, User.GHOST_USER]:
if user_obj.username in [User.DEFAULT_USER, User.GHOST_USER, User.AI_USER]:
return
now = time.time()
@ -270,7 +270,7 @@ class RepoAppView(BaseAppView):
def _prepare_and_set_clone_url(self, c):
username = ""
if self._rhodecode_user.username in [User.DEFAULT_USER, User.GHOST_USER]:
if self._rhodecode_user.username in [User.DEFAULT_USER, User.GHOST_USER, User.AI_USER]:
username = self._rhodecode_user.username
_def_clone_uri = c.clone_uri_tmpl
@ -558,7 +558,7 @@ class UserAppView(BaseAppView):
_ = self.request.translate
if not request.db_user_supports_default:
if self.db_user.username in [User.DEFAULT_USER, User.GHOST_USER]:
if self.db_user.username in [User.DEFAULT_USER, User.GHOST_USER, User.AI_USER]:
h.flash(
_("Editing user `{}` is disabled.".format(self.db_user.username)),
category="warning",