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
Check user/org repo limit instead of doer (#34147)
This PR tries to finally fix the bug mentioned in #30011 and #15504,
where the user repo limit is checked when creating a repo in an
organization.
Fix#30011
---------
Co-authored-by: wxiaoguang <[email protected]>
Co-authored-by: TheFox0x7 <[email protected]>
Copy file name to clipboardExpand all lines: models/user/user.go
+11-11
Original file line number
Diff line number
Diff line change
@@ -247,19 +247,20 @@ func (u *User) MaxCreationLimit() int {
247
247
returnu.MaxRepoCreation
248
248
}
249
249
250
-
// CanCreateRepo returns if user login can create a repository
251
-
// NOTE: functions calling this assume a failure due to repository count limit; if new checks are added, those functions should be revised
252
-
func (u*User) CanCreateRepo() bool {
250
+
// CanCreateRepoIn checks whether the doer(u) can create a repository in the owner
251
+
// 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
0 commit comments