aboutsummaryrefslogtreecommitdiffstats
path: root/models/db/name.go
Commit message (Collapse)AuthorAgeFilesLines
* Refactor error system (#33771)wxiaoguang2025-03-031-1/+1
| | | It should not expose `util.SilentWrap` or construct it manually.
* Refactor context flash msg and global variables (#33375)wxiaoguang2025-01-251-3/+1
| | | | | | 1. add `GetSiteCookieFlashMessage` to help to parse flash message 2. clarify `handleRepoHomeFeed` logic 3. remove unnecessary global variables, use `sync.OnceValue` instead 4. add some tests for `IsUsableUsername` and `IsUsableRepoName`
* Fix unittest and repo create bug (#33061)wxiaoguang2024-12-311-13/+6
| | | | | | | 1. `StatDir` was not right, fix the FIXME 2. Clarify the test cases for `IsUsableRepoName` 3. Fix regression bug in `repo-new.ts` Fix #33060
* Refactor db package and remove unnecessary `DumpTables` (#32930)wxiaoguang2024-12-201-1/+1
|
* Implement FSFE REUSE for golang files (#21840)flynnnnnnnnnn2022-11-271-2/+1
| | | | | | | | | Change all license headers to comply with REUSE specification. Fix #16132 Co-authored-by: flynnnnnnnnnn <flynnnnnnnnnn@github> Co-authored-by: John Olheiser <john.olheiser@gmail.com>
* Make every not exist error unwrappable to a fs.ErrNotExist (#20891)zeripath2022-10-181-3/+19
| | | | | | | | | | | | | | | | | | | | A lot of our code is repeatedly testing if individual errors are specific types of Not Exist errors. This is repetitative and unnecesary. `Unwrap() error` provides a common way of labelling an error as a NotExist error and we can/should use this. This PR has chosen to use the common `io/fs` errors e.g. `fs.ErrNotExist` for our errors. This is in some ways not completely correct as these are not filesystem errors but it seems like a reasonable thing to do and would allow us to simplify a lot of our code to `errors.Is(err, fs.ErrNotExist)` instead of `package.IsErr...NotExist(err)` I am open to suggestions to use a different base error - perhaps `models/db.ErrNotExist` if that would be felt to be better. Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
* Move user related model into models/user (#17781)Lunny Xiao2021-11-241-0/+91
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge