Browse Source

Fix create bugs (#9606)

Signed-off-by: jolheiser <john.olheiser@gmail.com>
tags/v1.11.0-rc1
John Olheiser techknowlogick 5 years ago
parent
commit
372e3081bf
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      routers/repo/repo.go
  2. +1
    -1
      web_src/js/index.js

+ 3
- 2
routers/repo/repo.go View File

@@ -180,6 +180,7 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
return
}

var repo *models.Repository
var err error
if form.RepoTemplate > 0 {
opts := models.GenerateRepoOptions{
@@ -209,14 +210,14 @@ func CreatePost(ctx *context.Context, form auth.CreateRepoForm) {
return
}

repo, err := repo_service.GenerateRepository(ctx.User, ctxUser, templateRepo, opts)
repo, err = repo_service.GenerateRepository(ctx.User, ctxUser, templateRepo, opts)
if err == nil {
log.Trace("Repository generated [%d]: %s/%s", repo.ID, ctxUser.Name, repo.Name)
ctx.Redirect(setting.AppSubURL + "/" + ctxUser.Name + "/" + repo.Name)
return
}
} else {
repo, err := repo_service.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
repo, err = repo_service.CreateRepository(ctx.User, ctxUser, models.CreateRepoOptions{
Name: form.RepoName,
Description: form.Description,
Gitignores: form.Gitignores,


+ 1
- 1
web_src/js/index.js View File

@@ -2271,7 +2271,7 @@ function initTemplateSearch() {
const checkTemplate = function () {
const $templateUnits = $('#template_units');
const $nonTemplate = $('#non_template');
if ($repoTemplate.val() !== '') {
if ($repoTemplate.val() !== '' && $repoTemplate.val() !== '0') {
$templateUnits.show();
$nonTemplate.hide();
} else {


Loading…
Cancel
Save