[PR #2117] [MERGED] Improve org error handling #16238

Closed
opened 2025-11-02 12:05:38 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/2117
Author: @sapk
Created: 7/6/2017
Status: Merged
Merged: 7/6/2017
Merged by: @lunny

Base: masterHead: better-org-err-handling


📝 Commits (2)

  • 0d24812 Improve ErrOrgNotExist type
  • ae4657c Fix unchanged method name report

📊 Changes

7 files changed (+26 additions, -12 deletions)

View changed files

📝 models/error.go (+16 -0)
📝 models/org.go (+2 -4)
📝 models/org_team.go (+1 -1)
📝 models/org_test.go (+2 -2)
📝 routers/api/v1/api.go (+3 -3)
📝 routers/api/v1/repo/fork.go (+1 -1)
📝 routers/api/v1/repo/repo.go (+1 -1)

📄 Description

And enforcement that :orgname is a org by using GetOrgByName inplace of GetUserByName and specific error check (GetOrgByName return ErrOrgNotExist not IsErrUserNotExist ) like it was done in CreateOrgRepo.
Before this PR we could use username as orgname.

This could also be done for enforcement of team in a other PR.


---

<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/2117 **Author:** [@sapk](https://github.com/sapk) **Created:** 7/6/2017 **Status:** ✅ Merged **Merged:** 7/6/2017 **Merged by:** [@lunny](https://github.com/lunny) **Base:** `master` ← **Head:** `better-org-err-handling` --- ### 📝 Commits (2) - [`0d24812`](https://github.com/go-gitea/gitea/commit/0d24812fede5a47e279cca1d0df279f7724d5b5a) Improve ErrOrgNotExist type - [`ae4657c`](https://github.com/go-gitea/gitea/commit/ae4657cc612792f30fc2076da72dead7823c8953) Fix unchanged method name report ### 📊 Changes **7 files changed** (+26 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `models/error.go` (+16 -0) 📝 `models/org.go` (+2 -4) 📝 `models/org_team.go` (+1 -1) 📝 `models/org_test.go` (+2 -2) 📝 `routers/api/v1/api.go` (+3 -3) 📝 `routers/api/v1/repo/fork.go` (+1 -1) 📝 `routers/api/v1/repo/repo.go` (+1 -1) </details> ### 📄 Description And enforcement that :orgname is a org by using GetOrgByName inplace of GetUserByName and specific error check (GetOrgByName return ErrOrgNotExist not IsErrUserNotExist ) like it was done in CreateOrgRepo. Before this PR we could use username as orgname. This could also be done for enforcement of team in a other PR. ~~~Note: I have quickly done this change via the web editor. It need to be tested but should be good.~~~ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 12:05:38 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#16238