chore: merge upstream changes

This commit is contained in:
cernst 2023-03-27 22:45:45 +02:00
commit 9d67a5f628
3 changed files with 8 additions and 2 deletions

View File

@ -90,6 +90,7 @@ This document describes the different errors Vikunja can return.
| 4019 | 400 | Invalid task filter value. |
| 4020 | 400 | The provided attachment does not belong to that task. |
| 4021 | 400 | This user is already assigned to that task. |
| 4022 | 400 | The task has a relative reminder which does not specify relative to what. |
## Namespace

View File

@ -898,7 +898,7 @@ func (err ErrReminderRelativeToMissing) HTTPError() web.HTTPError {
return web.HTTPError{
HTTPCode: http.StatusBadRequest,
Code: ErrCodeReminderRelativeToMissing,
Message: "Relative reminder without relative_to",
Message: "Please provide what the reminder date is relative to",
}
}

View File

@ -141,7 +141,12 @@ func (v *FileMigrator) Migrate(user *user.User, file io.ReaderAt, size int64) er
comment.ID = 0
}
for _, attachment := range t.Attachments {
af, err := storedFiles[attachment.File.ID].Open()
attachmentFile, exists := storedFiles[attachment.File.ID]
if !exists {
log.Debugf(logPrefix+"Could not find attachment file %d for attachment %d", attachment.File.ID, attachment.ID)
continue
}
af, err := attachmentFile.Open()
if err != nil {
return fmt.Errorf("could not open attachment %d for reading: %w", attachment.ID, err)
}