You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Some bug fixes
Former-commit-id: 54fc2a2869dd625e55881818e0022f3c4ae45bd1 [formerly ddba8f0dc58999a6f483fe61fda9391da251d49b] [formerly f76423c629f671538e6c008365c8d6dc1a5460d7 [formerly 82b161cfb2]]
Former-commit-id: 34601615e2beb773bf266cdb503e3c9fd8ead09b [formerly 0f39bbd2d66c789219785b4a726297a7c00a7f1e]
Former-commit-id: 1c2e33c56af3f57f8e8751b4c43b05967f87c587
This commit is contained in:
@@ -68,7 +68,6 @@ import (
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
|
||||
rice "github.com/GeertJohan/go.rice"
|
||||
"github.com/asdine/storm"
|
||||
"github.com/hacdias/fileutils"
|
||||
"github.com/mholt/caddy"
|
||||
"github.com/robfig/cron"
|
||||
@@ -165,7 +164,7 @@ func (m *FileManager) Setup() error {
|
||||
// Tries to get the event commands from the database.
|
||||
// If they don't exist, initialize them.
|
||||
err = m.Store.Config.Get("commands", &m.Commands)
|
||||
if err != nil && err == storm.ErrNotFound {
|
||||
if err != nil && err == ErrNotExist {
|
||||
m.Commands = map[string][]string{
|
||||
"before_save": {},
|
||||
"after_save": {},
|
||||
@@ -181,7 +180,7 @@ func (m *FileManager) Setup() error {
|
||||
|
||||
// Tries to fetch the users from the database.
|
||||
users, err := m.Store.Users.Gets(m.NewFS)
|
||||
if err != nil {
|
||||
if err != nil && err != ErrNotExist {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -460,6 +459,7 @@ type Store struct {
|
||||
// UsersStore is the interface to manage users.
|
||||
type UsersStore interface {
|
||||
Get(id int, builder FSBuilder) (*User, error)
|
||||
GetByUsername(username string, builder FSBuilder) (*User, error)
|
||||
Gets(builder FSBuilder) ([]*User, error)
|
||||
Save(u *User) error
|
||||
Update(u *User, fields ...string) error
|
||||
|
||||
Reference in New Issue
Block a user