summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorJonas Östanbäck <cez81@users.noreply.github.com>2017-05-20 05:51:19 +0200
committerLunny Xiao <xiaolunwen@gmail.com>2017-05-20 11:51:19 +0800
commit80cea8747fe87db98a9e930da6d664a245e5fc12 (patch)
treead65b28b121911bacf06f95ac07b7f6009eb5bed /models
parent977dcf96e0d9c5dded47ac6066fad8979a9f74f9 (diff)
downloadgitea-80cea8747fe87db98a9e930da6d664a245e5fc12.tar.gz
gitea-80cea8747fe87db98a9e930da6d664a245e5fc12.zip
Admin should always be allowed to create repos even if hit limit (#1765)
Diffstat (limited to 'models')
-rw-r--r--models/user.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 7e6bbd5dc3..75329d8ff0 100644
--- a/models/user.go
+++ b/models/user.go
@@ -221,6 +221,9 @@ func (u *User) RepoCreationNum() int {
// CanCreateRepo returns if user login can create a repository
func (u *User) CanCreateRepo() bool {
+ if u.IsAdmin {
+ return true
+ }
if u.MaxRepoCreation <= -1 {
if setting.Repository.MaxCreationLimit <= -1 {
return true