Skip to content

Pull Request page template error when a user with active PR is deleted #1708

Closed
@Avalancs

Description

@Avalancs
  • Gitea version (or commit ref): 1.1.1
  • Git version: git 2.12.2.windows.2
  • Operating system: Windows 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Steps: (EDIT: does not matter if a user is in an organization repo, or someone's private repo, so I removed Organization steps for simplicity)

  1. Create a user
  2. Add user to repository as collaborator
  3. Create a pull request with the user, but do not close or merge, so keep active
  4. Delete the user
  5. Navigate to the repository with the pull request, and open the "Pull Requests" tab
    Result: the error message "template: repo/issue/list:117:58: executing "repo/issue/list" at <.Poster.HomeLink>: can't evaluate field HomeLink in type *models.User" appears in a white page. The log does not have any entry about the failure in Trace mode.

long story:
After a fresh install, I created a repository and a user, then created a pull request with that user, which I did not close/merge, so it should appear in the pull requests tab. Then (tweaking ldap settings so the e-mail address and names could be fetched) I deleted and re-created the same user a couple of times. I did leave the organization and teams which the user was part of before deleting the first user, and later ones were not added to any organization/repo.
Then when I opened the repository, and clicked on the "Pull Requests" tab I got the following error message in the browser:
"template: repo/issue/list:117:58: executing "repo/issue/list" at <.Poster.HomeLink>: can't evaluate field HomeLink in type *models.User"

I could fix it by going into the database, and in the "issue" table I changed values in the "poster_id" column which did not exist in the "user" table to some value which exists there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions