Browse Source

index

tags/v1.21.12.1
yuyuanshifu 5 years ago
parent
commit
19f5d10d89
2 changed files with 2 additions and 11 deletions
  1. +0
    -9
      routers/repo/blockchain.go
  2. +2
    -2
      routers/routes/routes.go

+ 0
- 9
routers/repo/blockchain.go View File

@@ -24,16 +24,7 @@ const (
tplBlockChainIndex base.TplName = "repo/blockchain/index"
)

// MustEnableDataset check if repository enable internal cb
func MustEnableBlockChain(ctx *context.Context) {
if !ctx.Repo.CanRead(models.UnitTypeBlockChain) {
ctx.NotFound("MustEnableBlockChain", nil)
return
}
}

func BlockChainIndex(ctx *context.Context) {
//MustEnableBlockChain(ctx)
repo := ctx.Repo.Repository
if repo.ContractAddress == "" || ctx.User.PublicKey == ""{
log.Error("the repo(%d) or the user(%d) has not been initialized in block_chain", repo.RepoID, ctx.User.ID)


+ 2
- 2
routers/routes/routes.go View File

@@ -568,7 +568,7 @@ func RegisterRoutes(m *macaron.Macaron) {
reqRepoDatasetWriter := context.RequireRepoWriter(models.UnitTypeDatasets)
reqRepoCloudBrainReader := context.RequireRepoReader(models.UnitTypeCloudBrain)
reqRepoCloudBrainWriter := context.RequireRepoWriter(models.UnitTypeCloudBrain)
reqRepoBlockChainReader := context.RequireRepoReader(models.UnitTypeBlockChain)
//reqRepoBlockChainReader := context.RequireRepoReader(models.UnitTypeBlockChain)
//reqRepoBlockChainWriter := context.RequireRepoWriter(models.UnitTypeBlockChain)

// ***** START: Organization *****
@@ -914,7 +914,7 @@ func RegisterRoutes(m *macaron.Macaron) {
}, context.RepoRef())

m.Group("/blockchain", func() {
m.Get("", reqRepoBlockChainReader, repo.BlockChainIndex)
m.Get("", repo.BlockChainIndex)
}, context.RepoRef())

m.Group("/wiki", func() {


Loading…
Cancel
Save