Browse Source

fix-bug

tags/V1.22.3.1^2
liuzx 3 years ago
parent
commit
d529fb9e50
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      modules/util/util.go
  2. +1
    -1
      routers/repo/cloudbrain.go

+ 1
- 1
modules/util/util.go View File

@@ -115,7 +115,7 @@ func AddZero(t int64) (m string) {

func ConvertDisplayJobNameToJobName(DisplayName string) (JobName string) {
t := time.Now()
JobName = "jobname" + strings.ToLower(cutNameString(DisplayName, 15)) + "t" + t.Format("2006010215") + strconv.Itoa(int(rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(100000)))
JobName = "name" + strings.ToLower(cutNameString(DisplayName, 15)) + "t" + t.Format("2006010215") + strconv.Itoa(int(rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(100000)))
return JobName
}



+ 1
- 1
routers/repo/cloudbrain.go View File

@@ -206,7 +206,7 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) {
}
}

if !jobNamePattern.MatchString(jobName) {
if !jobNamePattern.MatchString(displayJobName) {
ctx.RenderWithErr(ctx.Tr("repo.cloudbrain_jobname_err"), tplCloudBrainNew, &form)
return
}


Loading…
Cancel
Save