mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-14 05:52:43 +00:00
Fix #186
This commit is contained in:
parent
16e162b669
commit
956f011dd3
7 changed files with 43 additions and 14 deletions
|
@ -125,8 +125,8 @@ func (repo *Repository) GetOwner() (err error) {
|
|||
}
|
||||
|
||||
// IsRepositoryExist returns true if the repository with given name under user has already existed.
|
||||
func IsRepositoryExist(user *User, repoName string) (bool, error) {
|
||||
repo := Repository{OwnerId: user.Id}
|
||||
func IsRepositoryExist(u *User, repoName string) (bool, error) {
|
||||
repo := Repository{OwnerId: u.Id}
|
||||
has, err := orm.Where("lower_name = ?", strings.ToLower(repoName)).Get(&repo)
|
||||
if err != nil {
|
||||
return has, err
|
||||
|
@ -134,7 +134,7 @@ func IsRepositoryExist(user *User, repoName string) (bool, error) {
|
|||
return false, nil
|
||||
}
|
||||
|
||||
return com.IsDir(RepoPath(user.Name, repoName)), nil
|
||||
return com.IsDir(RepoPath(u.Name, repoName)), nil
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue