Clean code
This commit is contained in:
parent
631deb2e7d
commit
828c89de99
7 changed files with 19 additions and 26 deletions
|
@ -5,6 +5,8 @@
|
|||
package middleware
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/codegangsta/martini"
|
||||
|
||||
"github.com/gogits/gogs/models"
|
||||
|
@ -31,9 +33,7 @@ func RepoAssignment(redirect bool) martini.Handler {
|
|||
ctx.Render.Redirect("/")
|
||||
return
|
||||
}
|
||||
//data["ErrorMsg"] = err
|
||||
//log.Error("repo.Single: %v", err)
|
||||
//r.HTML(200, "base/error", data)
|
||||
ctx.Handle(200, "RepoAssignment", err)
|
||||
return
|
||||
}
|
||||
} else {
|
||||
|
@ -45,9 +45,7 @@ func RepoAssignment(redirect bool) martini.Handler {
|
|||
ctx.Render.Redirect("/")
|
||||
return
|
||||
}
|
||||
//data["ErrorMsg"] = "invliad user account for single repository"
|
||||
//log.Error("repo.Single: %v", err)
|
||||
//r.HTML(200, "base/error", data)
|
||||
ctx.Handle(200, "RepoAssignment", errors.New("invliad user account for single repository"))
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -60,9 +58,7 @@ func RepoAssignment(redirect bool) martini.Handler {
|
|||
ctx.Render.Redirect("/")
|
||||
return
|
||||
}
|
||||
//data["ErrorMsg"] = err
|
||||
//log.Error("repo.Single: %v", err)
|
||||
//r.HTML(200, "base/error", data)
|
||||
ctx.Handle(200, "RepoAssignment", err)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue