|
|
@@ -6,6 +6,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/base" |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
) |
|
|
|
|
|
|
|
const ( |
|
|
@@ -58,23 +59,25 @@ func CreatePost(ctx *context.Context, form auth.CreateDatasetForm) { |
|
|
|
Description: form.Description, |
|
|
|
License: form.License, |
|
|
|
Task: form.Task, |
|
|
|
Release_id: form.Release_id, |
|
|
|
User_id: ctxUser.ID, |
|
|
|
ReleaseID: form.ReleaseID, |
|
|
|
UserID: ctxUser.ID, |
|
|
|
Status: 0, |
|
|
|
} |
|
|
|
log.Debug("======================================") |
|
|
|
log.Debug("%#v", opts) |
|
|
|
log.Debug("======================================") |
|
|
|
// if !opts.IsValid() { |
|
|
|
// ctx.RenderWithErr(ctx.Tr("repo.template.one_item"), tplCreate, form) |
|
|
|
// return |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
if err = models.CreateDataset(&opts); err != nil { |
|
|
|
log.Error("%v", err) |
|
|
|
} |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
log.Trace("Dataset created [%d]: %s/%s", opts.ID, ctxUser.Name, opts.Title) |
|
|
|
ctx.Redirect(setting.AppSubURL + "/datasets") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
// handleCreateError(ctx, ctxUser, err, "CreatePost", tplCreate, &form) |
|
|
|
} |
|
|
|
|
|
|
|