Mercurial > kallithea
diff rhodecode/model/db.py @ 1585:56276c716599 beta
Remove dead code
author | Nicolas VINOT <aeris@imirhil.fr> |
---|---|
date | Sat, 01 Oct 2011 16:38:51 +0200 |
parents | 3338a0994472 |
children | 2ccb32ddcfd7 |
line wrap: on
line diff
--- a/rhodecode/model/db.py Sat Oct 01 16:34:07 2011 +0200 +++ b/rhodecode/model/db.py Sat Oct 01 16:38:51 2011 +0200 @@ -504,28 +504,6 @@ return "<%s('%s:%s')>" % (self.__class__.__name__, self.repo_id, self.repo_name) - @staticmethod - def create(name, description, repo_type, private, owner, group, clone): - try: - repo = Repository() - repo.repo_name = name - repo.clone_uri = clone - repo.repo_type = repo_type - repo.user = owner - repo.private = private - repo.description = description - repo.group = group - - Session.add(repo) - Session.commit() - - RepoToPerm.create(repo, owner, Permission.get_by_name('repository.write')) - return repo - except: - log.error(traceback.format_exc()) - Session.rollback() - raise - @classmethod def by_repo_name(cls, repo_name): q = cls.query().filter(cls.repo_name == repo_name) @@ -856,23 +834,6 @@ permission = relationship('Permission') repository = relationship('Repository') - @staticmethod - def create(repo, user, p): - try: - perm = RepoToPerm() - perm.repository = repo - perm.user = user - perm.permission = p - - Session.add(perm) - Session.commit() - - return perm - except: - log.error(traceback.format_exc()) - Session.rollback() - raise - class UserToPerm(Base, BaseModel): __tablename__ = 'user_to_perm' __table_args__ = (UniqueConstraint('user_id', 'permission_id'), {'extend_existing':True})