fixed lint + fmt

This commit is contained in:
konrad 2018-07-14 17:37:46 +02:00 committed by kolaente
parent bc0e6da602
commit a5552b8f9d
Signed by untrusted user: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 5 additions and 3 deletions

View File

@ -22,6 +22,7 @@ func (Team) TableName() string {
return "teams" return "teams"
} }
// AfterLoad gets the created by user object
func (t *Team) AfterLoad() { func (t *Team) AfterLoad() {
// Get the owner // Get the owner
*t.CreatedBy, _, _ = GetUserByID(t.CreatedByID) *t.CreatedBy, _, _ = GetUserByID(t.CreatedByID)
@ -94,4 +95,4 @@ func (t *Team) Empty() {
t.Name = "" t.Name = ""
t.Description = "" t.Description = ""
t.Members = []*User{} t.Members = []*User{}
} }

View File

@ -1,5 +1,6 @@
package models package models
// Create is the handler to create a team
func (t *Team) Create(doer *User, _ int64) (err error) { func (t *Team) Create(doer *User, _ int64) (err error) {
// Check if we have a name // Check if we have a name
if t.Name == "" { if t.Name == "" {

View File

@ -4,4 +4,4 @@ package models
func (n *Team) CanCreate(user *User, id int64) bool { func (n *Team) CanCreate(user *User, id int64) bool {
// This is currently a dummy function, later on we could imagine global limits etc. // This is currently a dummy function, later on we could imagine global limits etc.
return true return true
} }

View File

@ -1,10 +1,10 @@
package crud package crud
import ( import (
"fmt"
"git.kolaente.de/konrad/list/models" "git.kolaente.de/konrad/list/models"
"github.com/labstack/echo" "github.com/labstack/echo"
"net/http" "net/http"
"fmt"
) )
// CreateWeb is the handler to create an object // CreateWeb is the handler to create an object