From 80cea8747fe87db98a9e930da6d664a245e5fc12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20=C3=96stanb=C3=A4ck?=
 <cez81@users.noreply.github.com>
Date: Sat, 20 May 2017 05:51:19 +0200
Subject: [PATCH] Admin should always be allowed to create repos even if hit
 limit (#1765)

---
 models/user.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/models/user.go b/models/user.go
index 7e6bbd5dc..75329d8ff 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