diff options
author | Unknwon <u@gogs.io> | 2015-11-16 10:14:12 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-11-16 10:14:12 -0500 |
commit | 134d8e7681d098b8b37d4ee47cea0e03d643965d (patch) | |
tree | bd14c2318fce4b282687d41e77fba3b268bd4bc1 /models/user.go | |
parent | c9b65f0fdcaebb23cc6071e86881f623e6b6a3e7 (diff) | |
download | gitea-134d8e7681d098b8b37d4ee47cea0e03d643965d.tar.gz gitea-134d8e7681d098b8b37d4ee47cea0e03d643965d.zip |
work on #1961
Diffstat (limited to 'models/user.go')
-rw-r--r-- | models/user.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go index 5aaf630f4a..18dce976f6 100644 --- a/models/user.go +++ b/models/user.go @@ -109,6 +109,12 @@ func (u *User) AfterSet(colName string, _ xorm.Cell) { } } +// HasForkedRepo checks if user has already forked a repository with given ID. +func (u *User) HasForkedRepo(repoID int64) bool { + _, has := HasForkedRepo(u.Id, repoID) + return has +} + // CanEditGitHook returns true if user can edit Git hooks. func (u *User) CanEditGitHook() bool { return u.IsAdmin || u.AllowGitHook |