Fixed registration handler
This commit is contained in:
		@ -126,7 +126,12 @@ func NewActivation(code string) error {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func UseActivation(code string) bool {
 | 
					func UseActivation(code string) bool {
 | 
				
			||||||
	_, err := db.Exec(`delete from activations where code = $1`, code)
 | 
						exists := false
 | 
				
			||||||
 | 
						err := db.Get(&exists, `SELECT exists(SELECT 1 FROM chats WHERE code = $1);`, code)
 | 
				
			||||||
 | 
						if err != nil || !exists {
 | 
				
			||||||
 | 
							return false
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						_, err = db.Exec(`delete from activations where code = $1`, code)
 | 
				
			||||||
	return err == nil
 | 
						return err == nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user