mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 02:02:26 -05:00
chunking away at it
This commit is contained in:
parent
0a244be523
commit
f58f77bf1f
23 changed files with 860 additions and 394 deletions
|
|
@ -21,12 +21,17 @@ package account
|
|||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gotosocial/gotosocial/internal/config"
|
||||
"github.com/gotosocial/gotosocial/internal/db"
|
||||
"github.com/gotosocial/gotosocial/internal/util"
|
||||
"github.com/gotosocial/gotosocial/pkg/mastotypes"
|
||||
)
|
||||
|
||||
func validateCreateAccount(form *mastotypes.AccountCreateRequest, reasonRequired bool, database db.DB) error {
|
||||
func validateCreateAccount(form *mastotypes.AccountCreateRequest, c *config.AccountsConfig, database db.DB) error {
|
||||
if !c.OpenRegistration {
|
||||
return errors.New("registration is not open for this server")
|
||||
}
|
||||
|
||||
if err := util.ValidateSignUpUsername(form.Username); err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
@ -47,7 +52,7 @@ func validateCreateAccount(form *mastotypes.AccountCreateRequest, reasonRequired
|
|||
return err
|
||||
}
|
||||
|
||||
if err := util.ValidateSignUpReason(form.Reason, reasonRequired); err != nil {
|
||||
if err := util.ValidateSignUpReason(form.Reason, c.ReasonRequired); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue