diff --git a/models/org_team.go b/models/org_team.go index 77acddc0e0..61b7ff9e7e 100644 --- a/models/org_team.go +++ b/models/org_team.go @@ -691,8 +691,8 @@ func UpdateTeam(t *Team, authChanged, includeAllChanged bool) (err error) { return errors.New("empty team name") } - if len(t.Description) > 255 { - t.Description = t.Description[:255] + if len(t.Description) > 1024 { + t.Description = t.Description[:1024] } ctx, committer, err := db.TxContext() diff --git a/models/repo.go b/models/repo.go index 29bb196e8e..27ae10688a 100644 --- a/models/repo.go +++ b/models/repo.go @@ -635,8 +635,8 @@ func DecrementRepoForkNum(ctx context.Context, repoID int64) error { func updateRepository(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) (err error) { repo.LowerName = strings.ToLower(repo.Name) - if utf8.RuneCountInString(repo.Description) > 255 { - repo.Description = string([]rune(repo.Description)[:255]) + if utf8.RuneCountInString(repo.Description) > 1024 { + repo.Description = string([]rune(repo.Description)[:1024]) } if utf8.RuneCountInString(repo.Website) > 255 { repo.Website = string([]rune(repo.Website)[:255]) diff --git a/models/user/user.go b/models/user/user.go index e375f3de0a..1bd5a907aa 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -188,7 +188,7 @@ func (u *User) BeforeUpdate() { u.LowerName = strings.ToLower(u.Name) u.Location = base.TruncateString(u.Location, 255) u.Website = base.TruncateString(u.Website, 255) - u.Description = base.TruncateString(u.Description, 255) + u.Description = base.TruncateString(u.Description, 1024) } // AfterLoad is invoked from XORM after filling all the fields of this object. diff --git a/modules/structs/org.go b/modules/structs/org.go index d8bd59e1ec..8eebf7b635 100644 --- a/modules/structs/org.go +++ b/modules/structs/org.go @@ -31,7 +31,7 @@ type CreateOrgOption struct { // required: true UserName string `json:"username" binding:"Required"` FullName string `json:"full_name"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public` (default), `limited` or `private` @@ -45,7 +45,7 @@ type CreateOrgOption struct { // EditOrgOption options for editing an organization type EditOrgOption struct { FullName string `json:"full_name"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` // possible values are `public`, `limited` or `private` diff --git a/modules/structs/org_team.go b/modules/structs/org_team.go index 53e3fcf62d..6d2b502f00 100644 --- a/modules/structs/org_team.go +++ b/modules/structs/org_team.go @@ -26,7 +26,7 @@ type Team struct { type CreateTeamOption struct { // required: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` IncludesAllRepositories bool `json:"includes_all_repositories"` // enum: read,write,admin Permission string `json:"permission"` @@ -42,7 +42,7 @@ type CreateTeamOption struct { type EditTeamOption struct { // required: true Name string `json:"name" binding:"AlphaDashDot;MaxSize(30)"` - Description *string `json:"description" binding:"MaxSize(255)"` + Description *string `json:"description" binding:"MaxSize(1024)"` IncludesAllRepositories *bool `json:"includes_all_repositories"` // enum: read,write,admin Permission string `json:"permission"` diff --git a/modules/structs/repo.go b/modules/structs/repo.go index 178704ab4f..b8f72a411c 100644 --- a/modules/structs/repo.go +++ b/modules/structs/repo.go @@ -107,7 +107,7 @@ type CreateRepoOption struct { // unique: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"` // Description of the repository to create - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` // Whether the repository is private Private bool `json:"private"` // Label-Set to use @@ -136,7 +136,7 @@ type EditRepoOption struct { // unique: true Name *string `json:"name,omitempty" binding:"OmitEmpty;AlphaDashDot;MaxSize(100);"` // a short description of the repository. - Description *string `json:"description,omitempty" binding:"MaxSize(255)"` + Description *string `json:"description,omitempty" binding:"MaxSize(1024)"` // a URL with more information about the repository. Website *string `json:"website,omitempty" binding:"MaxSize(255)"` // either `true` to make the repository private or `false` to make it public. @@ -200,7 +200,7 @@ type GenerateRepoOption struct { // unique: true Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"` // Description of the repository to create - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` // Whether the repository is private Private bool `json:"private"` // include git content of default branch in template repo @@ -309,7 +309,7 @@ type MigrateRepoOptions struct { LFS bool `json:"lfs"` LFSEndpoint string `json:"lfs_endpoint"` Private bool `json:"private"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` Wiki bool `json:"wiki"` Milestones bool `json:"milestones"` Labels bool `json:"labels"` diff --git a/modules/structs/user.go b/modules/structs/user.go index 431e230fac..a0587e9c90 100644 --- a/modules/structs/user.go +++ b/modules/structs/user.go @@ -82,7 +82,7 @@ type UserSettings struct { type UserSettingsOptions struct { FullName *string `json:"full_name" binding:"MaxSize(100)"` Website *string `json:"website" binding:"OmitEmpty;ValidUrl;MaxSize(255)"` - Description *string `json:"description" binding:"MaxSize(255)"` + Description *string `json:"description" binding:"MaxSize(1024)"` Location *string `json:"location" binding:"MaxSize(50)"` Language *string `json:"language"` Theme *string `json:"theme"` diff --git a/services/forms/org.go b/services/forms/org.go index dec2dbfa65..6be38a38ba 100644 --- a/services/forms/org.go +++ b/services/forms/org.go @@ -39,7 +39,7 @@ func (f *CreateOrgForm) Validate(req *http.Request, errs binding.Errors) binding type UpdateOrgSettingForm struct { Name string `binding:"Required;AlphaDashDot;MaxSize(40)" locale:"org.org_name_holder"` FullName string `binding:"MaxSize(100)"` - Description string `binding:"MaxSize(255)"` + Description string `binding:"MaxSize(1024)"` Website string `binding:"ValidUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` Visibility structs.VisibleType diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go index e78559912e..3fab9af1f1 100644 --- a/services/forms/repo_form.go +++ b/services/forms/repo_form.go @@ -74,7 +74,7 @@ type MigrateRepoForm struct { LFS bool `json:"lfs"` LFSEndpoint string `json:"lfs_endpoint"` Private bool `json:"private"` - Description string `json:"description" binding:"MaxSize(255)"` + Description string `json:"description" binding:"MaxSize(1024)"` Wiki bool `json:"wiki"` Milestones bool `json:"milestones"` Labels bool `json:"labels"` diff --git a/services/forms/user_form.go b/services/forms/user_form.go index a886e89f87..1f66b0dad0 100644 --- a/services/forms/user_form.go +++ b/services/forms/user_form.go @@ -245,7 +245,7 @@ type UpdateProfileForm struct { KeepEmailPrivate bool Website string `binding:"ValidSiteUrl;MaxSize(255)"` Location string `binding:"MaxSize(50)"` - Description string `binding:"MaxSize(255)"` + Description string `binding:"MaxSize(1024)"` Visibility structs.VisibleType KeepActivityPrivate bool }