1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +00:00

Fix the display of project type for deleted projects (#31732) (#31734)

Backport #31732 by @yp05327

Fix: #31727
After:

![image](https://github.com/user-attachments/assets/1dfb4b31-3bd6-47f7-b126-650f33f453e2)

Co-authored-by: yp05327 <576951401@qq.com>
This commit is contained in:
Giteabot
2024-07-30 14:05:14 +08:00
committed by GitHub
parent ec467c344f
commit 8591c918f6
4 changed files with 19 additions and 5 deletions

View File

@@ -109,6 +109,13 @@ type Project struct {
ClosedDateUnix timeutil.TimeStamp
}
// Ghost Project is a project which has been deleted
const GhostProjectID = -1
func (p *Project) IsGhost() bool {
return p.ID == GhostProjectID
}
func (p *Project) LoadOwner(ctx context.Context) (err error) {
if p.Owner != nil {
return nil