fix for file viewing
This commit is contained in:
parent
4de7184e9c
commit
c67e96a5d9
|
@ -27,7 +27,7 @@ func FileGetHandler(ctx *middleware.AppContext) http.Handler {
|
|||
return
|
||||
}
|
||||
|
||||
loc := filepath.Join(ctx.ConfigService.Location, f.Filename)
|
||||
loc := filepath.Join(ctx.ConfigService.Location, f.FullFilename)
|
||||
|
||||
w.Header().Set("Content-Type", f.ContentType)
|
||||
w.Header().Set("Content-Disposition", "inline")
|
||||
|
@ -172,9 +172,6 @@ func AdminUploadFilePostHandler(ctx *middleware.AppContext, w http.ResponseWrite
|
|||
file.Filename = filename
|
||||
file.Extension = ext
|
||||
|
||||
fmt.Println(filename)
|
||||
fmt.Println(ext)
|
||||
|
||||
_, err = ctx.FileService.Upload(file, data)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
@ -291,7 +291,7 @@ func (us UserService) Update(u *User, changePassword bool) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if oneAdmin {
|
||||
if oneAdmin && !u.Active {
|
||||
return httperror.New(http.StatusUnprocessableEntity,
|
||||
"Could not update user, because no user would remain",
|
||||
fmt.Errorf("could not update user %s action, because no administrator would remain", oldUser.Username))
|
||||
|
|
Loading…
Reference in New Issue