(self, repo, new_name)
return success
Renames a repo.

        Returns True on success.

        Raises ValueError if either name has invalid characters.
        Raises LookupError if the repo doesn't exist.
        Raises ValueError if the new name is taken.
        Raises PermissionDenied if not repo_base owner.
Renames a repo.
Renames a repo .
def rename_repo(self, repo, new_name):
        """
        Renames a repo.

        Returns True on success.

        Raises ValueError if either name has invalid characters.
        Raises LookupError if the repo doesn't exist.
        Raises ValueError if the new name is taken.
        Raises PermissionDenied if not repo_base owner.
        """
        # only a repo owner can rename a repo:
        if self.repo_base != self.username:
            raise PermissionDenied()

        # rename in user_con
        success = self.user_con.rename_repo(repo=repo, new_name=new_name)
        if success:
            # update collaborator(s), if there are any
            Collaborator.objects.filter(
                repo_name=repo, repo_base=self.repo_base).update(
                    repo_name=new_name)

        return success
def rename_repo ( self , repo , new_name ) : # only a repo owner can rename a repo: if self . repo_base != self . username : raise PermissionDenied ( ) # rename in user_con success = self . user_con . rename_repo ( repo = repo , new_name = new_name ) if success : # update collaborator(s), if there are any Collaborator . objects . filter ( repo_name = repo , repo_base = self . repo_base ) . update ( repo_name = new_name ) return success