feature: work in progress
This commit is contained in:
parent
58fce87f39
commit
203936cbd8
2 changed files with 12 additions and 12 deletions
|
|
@ -15,7 +15,7 @@
|
|||
# This program is dual-licensed. If you wish to learn more about the
|
||||
# RhodeCode Enterprise Edition, including its added features, Support services,
|
||||
# and proprietary license terms, please see https://rhodecode.com/licenses/
|
||||
|
||||
import itertools
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
|
@ -69,7 +69,6 @@ from rhodecode.model.db import (
|
|||
UserLog,
|
||||
)
|
||||
from rhodecode.model.permission import PermissionModel
|
||||
from rhodecode.model.settings import VcsSettingsModel
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
|
@ -769,6 +768,10 @@ class RepoModel(BaseModel):
|
|||
if not repo:
|
||||
return False
|
||||
|
||||
if not forks: # left for backward compatibility
|
||||
is_private = repo.private
|
||||
forks = "delete" if is_private else "detach"
|
||||
|
||||
if forks == "detach":
|
||||
for r in repo.forks:
|
||||
r.fork = None
|
||||
|
|
@ -782,15 +785,10 @@ class RepoModel(BaseModel):
|
|||
# check for pull requests
|
||||
pr_sources = repo.pull_requests_source
|
||||
pr_targets = repo.pull_requests_target
|
||||
if pull_requests != "delete" and (pr_sources or pr_targets):
|
||||
raise AttachedPullRequestsError()
|
||||
|
||||
artifacts_objs = repo.artifacts
|
||||
if artifacts == "delete":
|
||||
for a in artifacts_objs:
|
||||
self.sa.delete(a)
|
||||
elif [a for a in artifacts_objs]:
|
||||
raise AttachedArtifactsError()
|
||||
artifacts = repo.artifacts
|
||||
# FIXME: continue here
|
||||
for pr in itertools.chain(pr_sources, pr_targets, artifacts):
|
||||
self.sa.delete(pr)
|
||||
|
||||
old_repo_dict = repo.get_dict()
|
||||
if call_events:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue