mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-18 15:15:18 +00:00
Move attachment into models/repo/ (#17650)
* Move attachment into models/repo/ * Fix test * Fix bug
This commit is contained in:
parent
7a03473159
commit
fc3d082609
39 changed files with 477 additions and 414 deletions
|
@ -1679,29 +1679,6 @@ func (err ErrMilestoneNotExist) Error() string {
|
|||
return fmt.Sprintf("milestone does not exist [id: %d, repo_id: %d]", err.ID, err.RepoID)
|
||||
}
|
||||
|
||||
// _____ __ __ .__ __
|
||||
// / _ \_/ |__/ |______ ____ | |__ _____ ____ _____/ |_
|
||||
// / /_\ \ __\ __\__ \ _/ ___\| | \ / \_/ __ \ / \ __\
|
||||
// / | \ | | | / __ \\ \___| Y \ Y Y \ ___/| | \ |
|
||||
// \____|__ /__| |__| (____ /\___ >___| /__|_| /\___ >___| /__|
|
||||
// \/ \/ \/ \/ \/ \/ \/
|
||||
|
||||
// ErrAttachmentNotExist represents a "AttachmentNotExist" kind of error.
|
||||
type ErrAttachmentNotExist struct {
|
||||
ID int64
|
||||
UUID string
|
||||
}
|
||||
|
||||
// IsErrAttachmentNotExist checks if an error is a ErrAttachmentNotExist.
|
||||
func IsErrAttachmentNotExist(err error) bool {
|
||||
_, ok := err.(ErrAttachmentNotExist)
|
||||
return ok
|
||||
}
|
||||
|
||||
func (err ErrAttachmentNotExist) Error() string {
|
||||
return fmt.Sprintf("attachment does not exist [id: %d, uuid: %s]", err.ID, err.UUID)
|
||||
}
|
||||
|
||||
// ___________
|
||||
// \__ ___/___ _____ _____
|
||||
// | |_/ __ \\__ \ / \
|
||||
|
@ -1758,7 +1735,7 @@ type ErrUploadNotExist struct {
|
|||
|
||||
// IsErrUploadNotExist checks if an error is a ErrUploadNotExist.
|
||||
func IsErrUploadNotExist(err error) bool {
|
||||
_, ok := err.(ErrAttachmentNotExist)
|
||||
_, ok := err.(ErrUploadNotExist)
|
||||
return ok
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue