Skip to content

Commit 57ab24b

Browse files
committed
reduce cognitive complexity
1 parent 1907969 commit 57ab24b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,7 @@ func main() {
520520
}
521521

522522
if poll.CreatedBy != claims.UserInfo.Username {
523-
if slices.Contains(claims.UserInfo.Groups, "active_rtp") || slices.Contains(claims.UserInfo.Groups, "eboard") {
524-
} else {
523+
if !(slices.Contains(claims.UserInfo.Groups, "active_rtp") || slices.Contains(claims.UserInfo.Groups, "eboard")) {
525524
c.JSON(http.StatusForbidden, gin.H{"error": "You cannot end this poll."})
526525
return
527526
}

0 commit comments

Comments
 (0)