mirror of
				https://github.com/osmarks/mycorrhiza.git
				synced 2025-10-31 07:33:00 +00:00 
			
		
		
		
	Tidy up some more
This commit is contained in:
		| @@ -24,10 +24,10 @@ func canRenameThisToThat(oh *hyphae.Hypha, nh *hyphae.Hypha, u *user.User) (errt | |||||||
|  |  | ||||||
| 	if !hyphae.HyphaPattern.MatchString(nh.Name) { | 	if !hyphae.HyphaPattern.MatchString(nh.Name) { | ||||||
| 		rejectRenameLog(oh, u, fmt.Sprintf("new name ‘%s’ invalid", nh.Name)) | 		rejectRenameLog(oh, u, fmt.Sprintf("new name ‘%s’ invalid", nh.Name)) | ||||||
| 		return "Invalid name", errors.New("Invalid new name. Names cannot contain characters <code>^?!:#@><*|\"\\'&%</code>")  | 		return "Invalid name", errors.New("Invalid new name. Names cannot contain characters <code>^?!:#@><*|\"\\'&%</code>") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return "", nil  | 	return "", nil | ||||||
| } | } | ||||||
|  |  | ||||||
| // RenameHypha renames hypha from old name `hyphaName` to `newName` and makes a history record about that. If `recursive` is `true`, its subhyphae will be renamed the same way. | // RenameHypha renames hypha from old name `hyphaName` to `newName` and makes a history record about that. If `recursive` is `true`, its subhyphae will be renamed the same way. | ||||||
|   | |||||||
| @@ -152,7 +152,7 @@ func (f FormData) Get(key string) string { | |||||||
| 	return f.fields[key] | 	return f.fields[key] | ||||||
| } | } | ||||||
|  |  | ||||||
| // Put writes a form value for provided key  | // Put writes a form value for provided key | ||||||
| func (f FormData) Put(key, value string) { | func (f FormData) Put(key, value string) { | ||||||
| 	f.fields[key] = value | 	f.fields[key] = value | ||||||
| } | } | ||||||
|   | |||||||
| @@ -74,7 +74,7 @@ func handlerRobotsTxt(w http.ResponseWriter, rq *http.Request) { | |||||||
| 	file.Close() | 	file.Close() | ||||||
| } | } | ||||||
|  |  | ||||||
| // Handler initializes  | // Handler initializes and returns the HTTP router based on the configuration. | ||||||
| func Handler() http.Handler { | func Handler() http.Handler { | ||||||
| 	router := mux.NewRouter() | 	router := mux.NewRouter() | ||||||
| 	router.Use(func(next http.Handler) http.Handler { | 	router.Use(func(next http.Handler) http.Handler { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Mikhail Chekan
					Mikhail Chekan