summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-11-07 17:53:22 +0100
committerSandro Santilli <strk@kbt.io>2016-11-07 17:53:22 +0100
commitaadd7dcdc317c5e1665318b537162749514ac212 (patch)
tree5e4772ba6ca97dd7dca62325024ec4359b0636c0 /routers
parentb3828e38a5fbb92a92bae11e1e126b87fbad09c8 (diff)
downloadgitea-aadd7dcdc317c5e1665318b537162749514ac212.tar.gz
gitea-aadd7dcdc317c5e1665318b537162749514ac212.zip
And others
Diffstat (limited to 'routers')
-rw-r--r--routers/admin/orgs.go2
-rw-r--r--routers/admin/users.go2
-rw-r--r--routers/api/v1/admin/org.go2
-rw-r--r--routers/api/v1/user/user.go2
-rw-r--r--routers/home.go4
-rw-r--r--routers/org/org.go2
-rw-r--r--routers/repo/webhook.go14
7 files changed, 14 insertions, 14 deletions
diff --git a/routers/admin/orgs.go b/routers/admin/orgs.go
index efda1e5165..4d56797c73 100644
--- a/routers/admin/orgs.go
+++ b/routers/admin/orgs.go
@@ -22,7 +22,7 @@ func Organizations(ctx *context.Context) {
ctx.Data["PageIsAdminOrganizations"] = true
routers.RenderUserSearch(ctx, &routers.UserSearchOptions{
- Type: models.USER_TYPE_ORGANIZATION,
+ Type: models.UserTypeOrganization,
Counter: models.CountOrganizations,
Ranger: models.Organizations,
PageSize: setting.UI.Admin.OrgPagingNum,
diff --git a/routers/admin/users.go b/routers/admin/users.go
index 404d5ec3b1..445fb0021b 100644
--- a/routers/admin/users.go
+++ b/routers/admin/users.go
@@ -30,7 +30,7 @@ func Users(ctx *context.Context) {
ctx.Data["PageIsAdminUsers"] = true
routers.RenderUserSearch(ctx, &routers.UserSearchOptions{
- Type: models.USER_TYPE_INDIVIDUAL,
+ Type: models.UserTypeIndividual,
Counter: models.CountUsers,
Ranger: models.Users,
PageSize: setting.UI.Admin.UserPagingNum,
diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go
index 1deaa34b43..b764f7a813 100644
--- a/routers/api/v1/admin/org.go
+++ b/routers/api/v1/admin/org.go
@@ -27,7 +27,7 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) {
Website: form.Website,
Location: form.Location,
IsActive: true,
- Type: models.USER_TYPE_ORGANIZATION,
+ Type: models.UserTypeOrganization,
}
if err := models.CreateOrganization(org, u); err != nil {
if models.IsErrUserAlreadyExist(err) ||
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index e7322d725f..92ad7c81e5 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -16,7 +16,7 @@ import (
func Search(ctx *context.APIContext) {
opts := &models.SearchUserOptions{
Keyword: ctx.Query("q"),
- Type: models.USER_TYPE_INDIVIDUAL,
+ Type: models.UserTypeIndividual,
PageSize: com.StrTo(ctx.Query("limit")).MustInt(),
}
if opts.PageSize == 0 {
diff --git a/routers/home.go b/routers/home.go
index 10e75269b8..2dd223b748 100644
--- a/routers/home.go
+++ b/routers/home.go
@@ -172,7 +172,7 @@ func ExploreUsers(ctx *context.Context) {
ctx.Data["PageIsExploreUsers"] = true
RenderUserSearch(ctx, &UserSearchOptions{
- Type: models.USER_TYPE_INDIVIDUAL,
+ Type: models.UserTypeIndividual,
Counter: models.CountUsers,
Ranger: models.Users,
PageSize: setting.UI.ExplorePagingNum,
@@ -187,7 +187,7 @@ func ExploreOrganizations(ctx *context.Context) {
ctx.Data["PageIsExploreOrganizations"] = true
RenderUserSearch(ctx, &UserSearchOptions{
- Type: models.USER_TYPE_ORGANIZATION,
+ Type: models.UserTypeOrganization,
Counter: models.CountOrganizations,
Ranger: models.Organizations,
PageSize: setting.UI.ExplorePagingNum,
diff --git a/routers/org/org.go b/routers/org/org.go
index 156ccb3ee6..f937ac70d8 100644
--- a/routers/org/org.go
+++ b/routers/org/org.go
@@ -33,7 +33,7 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
org := &models.User{
Name: form.OrgName,
IsActive: true,
- Type: models.USER_TYPE_ORGANIZATION,
+ Type: models.UserTypeOrganization,
}
if err := models.CreateOrganization(org, ctx.User); err != nil {
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go
index 918c34016f..d18008b52e 100644
--- a/routers/repo/webhook.go
+++ b/routers/repo/webhook.go
@@ -134,9 +134,9 @@ func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
return
}
- contentType := models.JSON
- if models.HookContentType(form.ContentType) == models.FORM {
- contentType = models.FORM
+ contentType := models.ContentTypeJson
+ if models.HookContentType(form.ContentType) == models.ContentTypeForm {
+ contentType = models.ContentTypeForm
}
w := &models.Webhook{
@@ -192,7 +192,7 @@ func SlackHooksNewPost(ctx *context.Context, form auth.NewSlackHookForm) {
w := &models.Webhook{
RepoID: orCtx.RepoID,
URL: form.PayloadURL,
- ContentType: models.JSON,
+ ContentType: models.ContentTypeJson,
HookEvent: ParseHookEvent(form.WebhookForm),
IsActive: form.Active,
HookTaskType: models.SLACK,
@@ -281,9 +281,9 @@ func WebHooksEditPost(ctx *context.Context, form auth.NewWebhookForm) {
return
}
- contentType := models.JSON
- if models.HookContentType(form.ContentType) == models.FORM {
- contentType = models.FORM
+ contentType := models.ContentTypeJson
+ if models.HookContentType(form.ContentType) == models.ContentTypeForm {
+ contentType = models.ContentTypeForm
}
w.URL = form.PayloadURL