Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TemplateRepo no longer in models.repo #17993

Merged
merged 5 commits into from
Dec 16, 2021

Conversation

Caellion
Copy link
Contributor

Fixes error 500 that appears when trying to browse code of a repository generated from template

@a1012112796
Copy link
Member

@Caellion Hello, would you please give more detail description about this issue? Thanks

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 15, 2021
@Caellion
Copy link
Contributor Author

@Caellion Hello, would you please give more detail description about this issue? Thanks

Certainly.

Due to recent refactors of repo model, the template repo/header.tmpl cannot find TemplateRepo, at this line:

{{if .IsGenerated}}<div class="fork-flag">{{$.i18n.Tr "repo.generated_from"}} <a href="{{.TemplateRepo.Link}}">{{.TemplateRepo.FullName}}</a></div>{{end}}

This causes gitea to display error 500 on any repo which has been initialized from a template.

@lunny lunny added type/bug skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. labels Dec 15, 2021
models/repo/repo.go Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Dec 15, 2021
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Dec 15, 2021
@lunny
Copy link
Member

lunny commented Dec 16, 2021

make L-G-T-M work.

@lunny lunny merged commit e79272a into go-gitea:main Dec 16, 2021
@Caellion Caellion deleted the fix-templaterepo branch December 16, 2021 08:50
Caellion added a commit to Caellion/gitea that referenced this pull request Dec 16, 2021
* 'main' of https://github.com/Caellion/gitea:
  Add Reindex buttons to repository settings page (go-gitea#17494)
  Set correct language for Dockerfile variants (go-gitea#17999)
  Fix TemplateRepo no longer in models.repo (go-gitea#17993)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
* Fixes error 500 that appears when trying to browse code of a repository generated from template

* forgot to update comment

* Update models/repo/repo.go

Co-authored-by: Lunny Xiao <[email protected]>

* Update repo.go

Co-authored-by: Lunny Xiao <[email protected]>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants