aboutsummaryrefslogtreecommitdiffstats
path: root/modules/context/org.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2017-12-20 23:43:26 -0800
committerLauris BH <lauris@nix.lv>2017-12-21 09:43:26 +0200
commit515cdaa85d6087d91a61ebe74fae39e0c4bdf1c4 (patch)
tree3a7143fc376af4402ca9008876be3afdc0c18efc /modules/context/org.go
parent529482135c8e9304dd7cdf08772eaba61d903894 (diff)
downloadgitea-515cdaa85d6087d91a61ebe74fae39e0c4bdf1c4.tar.gz
gitea-515cdaa85d6087d91a61ebe74fae39e0c4bdf1c4.zip
Fix ignored errors when checking if organization, team member (#3177)
Diffstat (limited to 'modules/context/org.go')
-rw-r--r--modules/context/org.go13
1 files changed, 10 insertions, 3 deletions
diff --git a/modules/context/org.go b/modules/context/org.go
index cfe9a26220..29cc67dcc8 100644
--- a/modules/context/org.go
+++ b/modules/context/org.go
@@ -73,14 +73,21 @@ func HandleOrgAssignment(ctx *Context, args ...bool) {
ctx.Org.IsTeamMember = true
ctx.Org.IsTeamAdmin = true
} else if ctx.IsSigned {
- ctx.Org.IsOwner = org.IsOwnedBy(ctx.User.ID)
+ ctx.Org.IsOwner, err = org.IsOwnedBy(ctx.User.ID)
+ if err != nil {
+ ctx.Handle(500, "IsOwnedBy", err)
+ return
+ }
+
if ctx.Org.IsOwner {
ctx.Org.IsMember = true
ctx.Org.IsTeamMember = true
ctx.Org.IsTeamAdmin = true
} else {
- if org.IsOrgMember(ctx.User.ID) {
- ctx.Org.IsMember = true
+ ctx.Org.IsMember, err = org.IsOrgMember(ctx.User.ID)
+ if err != nil {
+ ctx.Handle(500, "IsOrgMember", err)
+ return
}
}
} else {