Compare commits
2 Commits
d001c5a7fc
...
6947b1e4a4
Author | SHA1 | Date | |
---|---|---|---|
6947b1e4a4 | |||
2cc85379cc |
@ -23,7 +23,7 @@ var (
|
|||||||
scriptDir = path.Join("services", "registration")
|
scriptDir = path.Join("services", "registration")
|
||||||
)
|
)
|
||||||
|
|
||||||
func getFlags(fp string, debug bool) (*asm.FlagParser, error) {
|
func getParser(fp string, debug bool) (*asm.FlagParser, error) {
|
||||||
flagParser := asm.NewFlagParser().WithDebug()
|
flagParser := asm.NewFlagParser().WithDebug()
|
||||||
_, err := flagParser.Load(fp)
|
_, err := flagParser.Load(fp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -128,7 +128,7 @@ func main() {
|
|||||||
ctx := context.Background()
|
ctx := context.Background()
|
||||||
ctx = context.WithValue(ctx, "SessionId",sessionId)
|
ctx = context.WithValue(ctx, "SessionId",sessionId)
|
||||||
pfp := path.Join(scriptDir, "pp.csv")
|
pfp := path.Join(scriptDir, "pp.csv")
|
||||||
flagParser, err := getFlags(pfp, true)
|
flagParser, err := getParser(pfp, true)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
@ -172,7 +172,7 @@ func (h *Handlers) CreateAccount(ctx context.Context, sym string, input []byte)
|
|||||||
_, err = utils.ReadEntry(ctx, h.userdataStore, sessionId, utils.DATA_ACCOUNT_CREATED)
|
_, err = utils.ReadEntry(ctx, h.userdataStore, sessionId, utils.DATA_ACCOUNT_CREATED)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if db.IsNotFound(err) {
|
if db.IsNotFound(err) {
|
||||||
fmt.Println("Creating an account because it doesn't exist")
|
logg.Printf(logging.LVL_INFO, "Creating an account because it doesn't exist")
|
||||||
err = h.createAccountNoExist(ctx, sessionId, &res)
|
err = h.createAccountNoExist(ctx, sessionId, &res)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
@ -315,6 +315,8 @@ func (h *Handlers) SaveFamilyname(ctx context.Context, sym string, input []byte)
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return res,fmt.Errorf("a family name cannot be less than one character")
|
||||||
}
|
}
|
||||||
|
|
||||||
return res, nil
|
return res, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user