Make GetPossibleUserByID can handle deleted user (#37430)
Make sure deleted user won't cause 500 error, simplify the caller's code
This commit is contained in:
@@ -831,7 +831,7 @@ func ToOAuth2Application(app *auth.OAuth2Application) *api.OAuth2Application {
|
||||
|
||||
// ToLFSLock convert a LFSLock to api.LFSLock
|
||||
func ToLFSLock(ctx context.Context, l *git_model.LFSLock) *api.LFSLock {
|
||||
u, err := user_model.GetPossibleUserByID(ctx, l.OwnerID)
|
||||
_, u, err := user_model.GetPossibleUserByID(ctx, l.OwnerID)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user