mirror of
				https://codeberg.org/forgejo/forgejo.git
				synced 2025-10-31 06:21:11 +00:00 
			
		
		
		
	fix: generate correct SQL query for GetUserByEmail
		
	xorm ignores any boolean values that are set in the struct given via
`Get`: 7654b7b749/internal/statements/statement.go (L384-L390)
	
	
This commit is contained in:
		
					parent
					
						
							
								9828aca733
							
						
					
				
			
			
				commit
				
					
						e746cc80a4
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -1202,8 +1202,8 @@ func GetUserByEmail(ctx context.Context, email string) (*User, error) { | ||||||
| 
 | 
 | ||||||
| 	email = strings.ToLower(email) | 	email = strings.ToLower(email) | ||||||
| 	// Otherwise, check in alternative list for activated email addresses | 	// Otherwise, check in alternative list for activated email addresses | ||||||
| 	emailAddress := &EmailAddress{LowerEmail: email, IsActivated: true} | 	emailAddress := &EmailAddress{} | ||||||
| 	has, err := db.GetEngine(ctx).Get(emailAddress) | 	has, err := db.GetEngine(ctx).Where("lower_email = ? AND is_activated = ?", email, true).Get(emailAddress) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue