You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: models/user/user.go
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -249,8 +249,13 @@ func (u *User) MaxCreationLimit() int {
249
249
}
250
250
251
251
// CanCreateRepoIn checks whether the doer(u) can create a repository in the owner
252
-
// NOTE: functions calling this assume a failure due to repository count limit; it ONLY checks the repo number LIMIT, if new checks are added, those functions should be revised
252
+
// NOTE: functions calling this assume a failure due to repository count limit, or the owner is not a real user.
253
+
// It ONLY checks the repo number LIMIT or whether owner user is real. If new checks are added, those functions should be revised.
254
+
// TODO: the callers can only return ErrReachLimitOfRepo, need to fine tune to support other error types in the future.
253
255
func (u*User) CanCreateRepoIn(owner*User) bool {
256
+
ifu.ID<=0||owner.ID<=0 {
257
+
returnfalse// fake user like Ghost or Actions user
0 commit comments