mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-04 18:19:54 +00:00
Fix a Telegram-related bug
I removed my favorite comment: // Problems is something we put blankets on.
This commit is contained in:
parent
7b0aec0a2e
commit
3c32e40e59
@ -170,8 +170,9 @@ func handlerTelegramLogin(w http.ResponseWriter, rq *http.Request) {
|
||||
false,
|
||||
)
|
||||
)
|
||||
// If registering a user via Telegram failed, because a Telegram user with this name
|
||||
// has already registered, then everything is actually ok!
|
||||
if user.HasUsername(username) && user.ByName(username).Source == "telegram" {
|
||||
// Problems is something we put blankets on.
|
||||
err = nil
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ func Register(username, password, group, source string, force bool) error {
|
||||
return fmt.Errorf("username ‘%s’ is already taken", username)
|
||||
case !force && cfg.RegistrationLimit > 0 && Count() >= cfg.RegistrationLimit:
|
||||
return fmt.Errorf("reached the limit of registered users (%d)", cfg.RegistrationLimit)
|
||||
case password == "":
|
||||
case password == "" && source != "telegram":
|
||||
return fmt.Errorf("password must not be empty")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user