mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Project links should use parent link methods (#22587)
Instead of re-creating, these should use the available `Link` methods from the "parent" of the project, which also take sub-urls into account. Signed-off-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
		@@ -123,7 +123,7 @@ func (p *Project) Link() string {
 | 
				
			|||||||
			log.Error("LoadOwner: %v", err)
 | 
								log.Error("LoadOwner: %v", err)
 | 
				
			||||||
			return ""
 | 
								return ""
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return fmt.Sprintf("/%s/-/projects/%d", p.Owner.Name, p.ID)
 | 
							return fmt.Sprintf("%s/-/projects/%d", p.Owner.HomeLink(), p.ID)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if p.RepoID > 0 {
 | 
						if p.RepoID > 0 {
 | 
				
			||||||
		err := p.LoadRepo(db.DefaultContext)
 | 
							err := p.LoadRepo(db.DefaultContext)
 | 
				
			||||||
@@ -131,7 +131,7 @@ func (p *Project) Link() string {
 | 
				
			|||||||
			log.Error("LoadRepo: %v", err)
 | 
								log.Error("LoadRepo: %v", err)
 | 
				
			||||||
			return ""
 | 
								return ""
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		return fmt.Sprintf("/%s/projects/%d", p.Repo.RepoPath(), p.ID)
 | 
							return fmt.Sprintf("%s/projects/%d", p.Repo.Link(), p.ID)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return ""
 | 
						return ""
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user