aboutsummaryrefslogtreecommitdiff
path: root/routers/org/org.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-02-23 11:39:09 -0500
committerUnknwon <u@gogs.io>2017-02-27 22:45:35 -0500
commit4f9c5981a923687a803a3711fe33cd211584f36b (patch)
tree1ebef38e15be164ea34415211cd764c222d8cfee /routers/org/org.go
parentb3757e424ffc47f7ae07d8fecd9f2ecf98f20679 (diff)
refactoring: modules/auth/*_form.go -> modules/form
Diffstat (limited to 'routers/org/org.go')
-rw-r--r--routers/org/org.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/routers/org/org.go b/routers/org/org.go
index 1a6a821e..cf49733b 100644
--- a/routers/org/org.go
+++ b/routers/org/org.go
@@ -8,7 +8,7 @@ import (
log "gopkg.in/clog.v1"
"github.com/gogits/gogs/models"
- "github.com/gogits/gogs/modules/auth"
+ "github.com/gogits/gogs/modules/form"
"github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/modules/setting"
@@ -23,7 +23,7 @@ func Create(ctx *context.Context) {
ctx.HTML(200, CREATE)
}
-func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
+func CreatePost(ctx *context.Context, f form.CreateOrg) {
ctx.Data["Title"] = ctx.Tr("new_org")
if ctx.HasError() {
@@ -32,7 +32,7 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
}
org := &models.User{
- Name: form.OrgName,
+ Name: f.OrgName,
IsActive: true,
Type: models.USER_TYPE_ORGANIZATION,
}
@@ -41,11 +41,11 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
ctx.Data["Err_OrgName"] = true
switch {
case models.IsErrUserAlreadyExist(err):
- ctx.RenderWithErr(ctx.Tr("form.org_name_been_taken"), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("form.org_name_been_taken"), CREATE, &f)
case models.IsErrNameReserved(err):
- ctx.RenderWithErr(ctx.Tr("org.form.name_reserved", err.(models.ErrNameReserved).Name), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("org.form.name_reserved", err.(models.ErrNameReserved).Name), CREATE, &f)
case models.IsErrNamePatternNotAllowed(err):
- ctx.RenderWithErr(ctx.Tr("org.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("org.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), CREATE, &f)
default:
ctx.Handle(500, "CreateOrganization", err)
}
@@ -53,5 +53,5 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
}
log.Trace("Organization created: %s", org.Name)
- ctx.Redirect(setting.AppSubUrl + "/org/" + form.OrgName + "/dashboard")
+ ctx.Redirect(setting.AppSubUrl + "/org/" + f.OrgName + "/dashboard")
}