Fixed lint & misspell
This commit is contained in:
parent
a108ed689d
commit
06638fccc8
4 changed files with 9 additions and 9 deletions
|
@ -76,7 +76,7 @@ func (l *List) ReadOne() (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// GetSimple gets a list with only the basic items, aka no tasks or user objects. Returns an error if the list does not exist.
|
||||
// GetSimpleByID gets a list with only the basic items, aka no tasks or user objects. Returns an error if the list does not exist.
|
||||
func (l *List) GetSimpleByID() (err error) {
|
||||
if l.ID < 1 {
|
||||
return ErrListDoesNotExist{ID: l.ID}
|
||||
|
|
|
@ -48,7 +48,7 @@ func (l *List) CanRead(user *User) bool {
|
|||
// CanDelete checks if the user can delete a list
|
||||
func (l *List) CanDelete(doer *User) bool {
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanDelete for List: %s", err)
|
||||
Log.Error("Error occurred during CanDelete for List: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.IsAdmin(doer)
|
||||
|
@ -57,7 +57,7 @@ func (l *List) CanDelete(doer *User) bool {
|
|||
// CanUpdate checks if the user can update a list
|
||||
func (l *List) CanUpdate(doer *User) bool {
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanUpdate for List: %s", err)
|
||||
Log.Error("Error occurred during CanUpdate for List: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.CanWrite(doer)
|
||||
|
|
|
@ -31,7 +31,7 @@ func (lu *ListUser) CanCreate(doer *User) bool {
|
|||
// Get the list and check if the user has write access on it
|
||||
l := List{ID: lu.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanCreate for ListUser: %s", err)
|
||||
Log.Error("Error occurred during CanCreate for ListUser: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.CanWrite(doer)
|
||||
|
@ -42,7 +42,7 @@ func (lu *ListUser) CanDelete(doer *User) bool {
|
|||
// Get the list and check if the user has write access on it
|
||||
l := List{ID: lu.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanDelete for ListUser: %s", err)
|
||||
Log.Error("Error occurred during CanDelete for ListUser: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.CanWrite(doer)
|
||||
|
@ -53,7 +53,7 @@ func (lu *ListUser) CanUpdate(doer *User) bool {
|
|||
// Get the list and check if the user has write access on it
|
||||
l := List{ID: lu.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanUpdate for ListUser: %s", err)
|
||||
Log.Error("Error occurred during CanUpdate for ListUser: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.CanWrite(doer)
|
||||
|
|
|
@ -4,7 +4,7 @@ package models
|
|||
func (tl *TeamList) CanCreate(user *User) bool {
|
||||
l := List{ID: tl.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanCreate for TeamList: %s", err)
|
||||
Log.Error("Error occurred during CanCreate for TeamList: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.IsAdmin(user)
|
||||
|
@ -14,7 +14,7 @@ func (tl *TeamList) CanCreate(user *User) bool {
|
|||
func (tl *TeamList) CanDelete(user *User) bool {
|
||||
l := List{ID: tl.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanDelete for TeamList: %s", err)
|
||||
Log.Error("Error occurred during CanDelete for TeamList: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.IsAdmin(user)
|
||||
|
@ -24,7 +24,7 @@ func (tl *TeamList) CanDelete(user *User) bool {
|
|||
func (tl *TeamList) CanUpdate(user *User) bool {
|
||||
l := List{ID: tl.ListID}
|
||||
if err := l.GetSimpleByID(); err != nil {
|
||||
Log.Error("Error occured during CanUpdate for TeamList: %s", err)
|
||||
Log.Error("Error occurred during CanUpdate for TeamList: %s", err)
|
||||
return false
|
||||
}
|
||||
return l.IsAdmin(user)
|
||||
|
|
Loading…
Reference in a new issue