Merge pull request !2922 from rhodecode-enterprise-ce feature/RCCE-360__Repo-deletion
feature: implements the feature to delete a repository completely or leave backup
This commit is contained in:
commit
d61a7389cb
8 changed files with 137 additions and 36 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue