From 4f9c5981a923687a803a3711fe33cd211584f36b Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 23 Feb 2017 11:39:09 -0500 Subject: refactoring: modules/auth/*_form.go -> modules/form --- routers/org/org.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'routers/org/org.go') 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") } -- cgit v1.2.3