mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-19 16:30:15 +00:00
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
This commit is contained in:
parent
4e7ca946da
commit
a666829a37
345 changed files with 4230 additions and 3813 deletions
|
@ -168,9 +168,9 @@ func PostLockHandler(ctx *context.Context) {
|
|||
}
|
||||
|
||||
lock, err := models.CreateLFSLock(&models.LFSLock{
|
||||
Repo: repository,
|
||||
Path: req.Path,
|
||||
Owner: ctx.User,
|
||||
Repo: repository,
|
||||
Path: req.Path,
|
||||
OwnerID: ctx.User.ID,
|
||||
})
|
||||
if err != nil {
|
||||
if models.IsErrLFSLockAlreadyExist(err) {
|
||||
|
@ -249,7 +249,7 @@ func VerifyLockHandler(ctx *context.Context) {
|
|||
lockOursListAPI := make([]*api.LFSLock, 0, len(lockList))
|
||||
lockTheirsListAPI := make([]*api.LFSLock, 0, len(lockList))
|
||||
for _, l := range lockList {
|
||||
if l.Owner.ID == ctx.User.ID {
|
||||
if l.OwnerID == ctx.User.ID {
|
||||
lockOursListAPI = append(lockOursListAPI, convert.ToLFSLock(l))
|
||||
} else {
|
||||
lockTheirsListAPI = append(lockTheirsListAPI, convert.ToLFSLock(l))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue