summaryrefslogtreecommitdiffstats
path: root/routers/org
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-12-25 09:59:32 +0000
committerGitHub <noreply@github.com>2020-12-25 11:59:32 +0200
commita19447aed128ecadfcd938d6a80cd4951af1f4ce (patch)
tree6312bf946d601aab29731645a4777feeaea66036 /routers/org
parent04ae0f2f3f4556c6d0b4adc5f2cffd0cc7d25151 (diff)
downloadgitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.tar.gz
gitea-a19447aed128ecadfcd938d6a80cd4951af1f4ce.zip
migrate from com.* to alternatives (#14103)
* remove github.com/unknwon/com from models * dont use "com.ToStr()" * replace "com.ToStr" with "fmt.Sprint" where its easy to do * more refactor * fix test * just "proxy" Copy func for now * as per @lunny
Diffstat (limited to 'routers/org')
-rw-r--r--routers/org/members.go4
-rw-r--r--routers/org/teams.go6
2 files changed, 3 insertions, 7 deletions
diff --git a/routers/org/members.go b/routers/org/members.go
index 9f13d1be3f..00ca381ad0 100644
--- a/routers/org/members.go
+++ b/routers/org/members.go
@@ -11,8 +11,6 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
-
- "github.com/unknwon/com"
)
const (
@@ -70,7 +68,7 @@ func Members(ctx *context.Context) {
// MembersAction response for operation to a member of organization
func MembersAction(ctx *context.Context) {
- uid := com.StrTo(ctx.Query("uid")).MustInt64()
+ uid := ctx.QueryInt64("uid")
if uid == 0 {
ctx.Redirect(ctx.Org.OrgLink + "/members")
return
diff --git a/routers/org/teams.go b/routers/org/teams.go
index 03fbf068da..fa98add601 100644
--- a/routers/org/teams.go
+++ b/routers/org/teams.go
@@ -16,8 +16,6 @@ import (
"code.gitea.io/gitea/modules/context"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/routers/utils"
-
- "github.com/unknwon/com"
)
const (
@@ -50,7 +48,7 @@ func Teams(ctx *context.Context) {
// TeamsAction response for join, leave, remove, add operations to team
func TeamsAction(ctx *context.Context) {
- uid := com.StrTo(ctx.Query("uid")).MustInt64()
+ uid := ctx.QueryInt64("uid")
if uid == 0 {
ctx.Redirect(ctx.Org.OrgLink + "/teams")
return
@@ -155,7 +153,7 @@ func TeamsRepoAction(ctx *context.Context) {
}
err = ctx.Org.Team.AddRepository(repo)
case "remove":
- err = ctx.Org.Team.RemoveRepository(com.StrTo(ctx.Query("repoid")).MustInt64())
+ err = ctx.Org.Team.RemoveRepository(ctx.QueryInt64("repoid"))
case "addall":
err = ctx.Org.Team.AddAllRepositories()
case "removeall":