forked from vikunja/vikunja
fix: lint errors
This commit is contained in:
parent
dbbc99c581
commit
518bf7ded3
@ -88,3 +88,5 @@ issues:
|
||||
- path: pkg/models/favorites\.go
|
||||
linters:
|
||||
- nilerr
|
||||
- path: pkg/models/prject\.go
|
||||
text: "string `parent_project_id` has 3 occurrences, make it a constant"
|
||||
|
@ -17,8 +17,9 @@
|
||||
package migration
|
||||
|
||||
import (
|
||||
"src.techknowlogick.com/xormigrate"
|
||||
"time"
|
||||
|
||||
"src.techknowlogick.com/xormigrate"
|
||||
"xorm.io/xorm"
|
||||
"xorm.io/xorm/schemas"
|
||||
)
|
||||
|
@ -62,7 +62,7 @@ func ExportUserData(s *xorm.Session, u *user.User) (err error) {
|
||||
return err
|
||||
}
|
||||
// Task attachment files
|
||||
err = exportTaskAttachments(s, u, dumpWriter, taskIDs)
|
||||
err = exportTaskAttachments(s, dumpWriter, taskIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -213,7 +213,7 @@ func exportProjectsAndTasks(s *xorm.Session, u *user.User, wr *zip.Writer) (task
|
||||
return taskIDs, utils.WriteBytesToZip("data.json", data, wr)
|
||||
}
|
||||
|
||||
func exportTaskAttachments(s *xorm.Session, u *user.User, wr *zip.Writer, taskIDs []int64) (err error) {
|
||||
func exportTaskAttachments(s *xorm.Session, wr *zip.Writer, taskIDs []int64) (err error) {
|
||||
tas, err := getTaskAttachmentsByTaskIDs(s, taskIDs)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -17,6 +17,8 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"code.vikunja.io/api/pkg/user"
|
||||
"code.vikunja.io/web"
|
||||
"xorm.io/builder"
|
||||
@ -147,7 +149,8 @@ func (p *Project) CanUpdate(s *xorm.Session, a web.Auth) (canUpdate bool, err er
|
||||
|
||||
canUpdate, err = p.CanWrite(s, a)
|
||||
// If the project is archived and the user tries to un-archive it, let the request through
|
||||
archivedErr, is := err.(ErrProjectIsArchived)
|
||||
archivedErr := ErrProjectIsArchived{}
|
||||
is := errors.As(err, &archivedErr)
|
||||
if is && !p.IsArchived && archivedErr.ProjectID == p.ID {
|
||||
err = nil
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ func getSubscribersForEntity(s *xorm.Session, entityType SubscriptionEntityType,
|
||||
}
|
||||
|
||||
userIDs := []int64{}
|
||||
subscriptions = make([]*Subscription, len(subs))
|
||||
subscriptions = make([]*Subscription, 0, len(subs))
|
||||
for _, subss := range subs {
|
||||
for _, subscription := range subss {
|
||||
userIDs = append(userIDs, subscription.UserID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user