# HG changeset patch # User Marcin Kuzminski # Date 2019-06-17 07:58:48 # Node ID d8a6de0a584ddc78c47806062402397809d64207 # Parent c36477cc4337f3f1a287a6467a19bb852a13e774 artifacts: show attached artifacts in advanced page, and delete them on repo deletion diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -1678,11 +1678,12 @@ class Repository(Base, BaseModel): cascade="all, delete, delete-orphan") ui = relationship('RepoRhodeCodeUi', cascade="all") settings = relationship('RepoRhodeCodeSetting', cascade="all") - integrations = relationship('Integration', - cascade="all, delete, delete-orphan") + integrations = relationship('Integration', cascade="all, delete, delete-orphan") scoped_tokens = relationship('UserApiKeys', cascade="all") + artifacts = relationship('FileStore', cascade="all") + def __unicode__(self): return u"<%s('%s:%s')>" % (self.__class__.__name__, self.repo_id, safe_unicode(self.repo_name)) diff --git a/rhodecode/templates/admin/repos/repo_edit_advanced.mako b/rhodecode/templates/admin/repos/repo_edit_advanced.mako --- a/rhodecode/templates/admin/repos/repo_edit_advanced.mako +++ b/rhodecode/templates/admin/repos/repo_edit_advanced.mako @@ -11,6 +11,7 @@ (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]), (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]), (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]), + (_('Attached Artifacts'), len(c.rhodecode_db_repo.artifacts), '', ''), ] %>