feature: implements the feature to delete a repository completely or leave backup

This commit is contained in:
ievgenii vdovenko 2025-12-17 16:13:22 +01:00
parent 203ea853e4
commit 376aa04b3c
7 changed files with 132 additions and 35 deletions

View file

@ -27,6 +27,7 @@ from rhodecode.lib import helpers as h
from rhodecode.lib import audit_logger
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator, CSRFRequired, HasRepoPermissionAny
from rhodecode.lib.exceptions import AttachedForksError, AttachedPullRequestsError, AttachedArtifactsError
from rhodecode.lib.type_utils import str2bool
from rhodecode.lib.utils2 import safe_int
from rhodecode.lib.vcs import RepositoryError
from rhodecode.model.db import Session, UserFollowing, User, Repository
@ -143,7 +144,10 @@ class RepoSettingsAdvancedView(RepoAppView):
delete_cache = True
self._invalidate_remote_cache(delete=delete_cache)
delete_res = RepoModel().delete(self.db_repo)
backup = str2bool(
self.request.POST.get("backup", "false")
) # if this option is absent, this means that on FE side checkbox was unchecked
delete_res = RepoModel().delete(self.db_repo, fs_backup=backup)
fork_action = delete_res.fork_action_result.action
fork_cnt = delete_res.fork_action_result.fork_count