diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-04-17 23:35:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-17 11:35:57 -0400 |
commit | f20057271def2240474d64c57eeba8b365642c08 (patch) | |
tree | 4b7b081a4ab7b5ba8a593b651fc199d1d59732b4 /modules | |
parent | 4b1c6cd8e5745a945df0f72233964f6aede8a3a6 (diff) | |
download | gitea-f20057271def2240474d64c57eeba8b365642c08.tar.gz gitea-f20057271def2240474d64c57eeba8b365642c08.zip |
Fix Org edit page bugs: renaming detection, maxlength (#24161)
## Before
* The renaming detection is wrong (eg: pasting a new name into the input
doesn't trigger the detection)
* The renaming prompt layout is not good
* Some MaxSize/maxlength rules is missing
![image](https://user-images.githubusercontent.com/2114189/232379191-5d0f6d10-56ca-4cec-ac52-7f77b9cb4a8a.png)
![image](https://user-images.githubusercontent.com/2114189/232379234-3289373b-9ddb-4627-ae86-f4d74589fa0c.png)
## After
* Fix these problems
![image](https://user-images.githubusercontent.com/2114189/232379098-31c6fa21-c210-4e7f-a337-b38b99670835.png)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/structs/org.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/structs/org.go b/modules/structs/org.go index b4c58623fd..7c83dcdee7 100644 --- a/modules/structs/org.go +++ b/modules/structs/org.go @@ -30,8 +30,8 @@ type OrganizationPermissions struct { // CreateOrgOption options for creating an organization type CreateOrgOption struct { // required: true - UserName string `json:"username" binding:"Required"` - FullName string `json:"full_name"` + UserName string `json:"username" binding:"Required;Username;MaxSize(40)"` + FullName string `json:"full_name" binding:"MaxSize(100)"` Description string `json:"description" binding:"MaxSize(255)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` @@ -45,7 +45,7 @@ type CreateOrgOption struct { // EditOrgOption options for editing an organization type EditOrgOption struct { - FullName string `json:"full_name"` + FullName string `json:"full_name" binding:"MaxSize(100)"` Description string `json:"description" binding:"MaxSize(255)"` Website string `json:"website" binding:"ValidUrl;MaxSize(255)"` Location string `json:"location" binding:"MaxSize(50)"` |