Closed Nostix closed 4 years ago
Good catch, thanks!
You might also want to take a look at the default values as the validation fails everytime because of the empty password and email strings. Furthermore the register_user function now always returns the user, but the _init_default_user function raises an exeption if the function returns anything. Because of this, even if the user gets registered correctly, an exeption is raised.
Fix error created by wrong method call on first startup in single user mode.
Stacktrace: api | INFO:root:Single user mode api | File "/usr/local/bin/plynx", line 33, in
api | File "/usr/local/lib/python3.7/site-packages/plynx-1.5.0-py3.7.egg/plynx/bin/init.py", line 13, in main
api | args.func(kwargs)
api | File "/usr/local/lib/python3.7/site-packages/plynx-1.5.0-py3.7.egg/plynx/bin/cli.py", line 26, in api
api | run_api(**args)
api | File "/usr/local/lib/python3.7/site-packages/plynx-1.5.0-py3.7.egg/plynx/web/common.py", line 160, in run_api
api | _init_default_user()
api | File "/usr/local/lib/python3.7/site-packages/plynx-1.5.0-py3.7.egg/plynx/web/common.py", line 111, in _init_default_user
api | message = register_user(DEFAULT_EMAIL, DEFAULT_USERNAME, DEFAULT_PASSWORD)
api | File "/usr/local/lib/python3.7/site-packages/plynx-1.5.0-py3.7.egg/plynx/web/common.py", line 72, in register_user
api | error_code=RegisterUserExceptionCode.EMPTY_USERNAME
api | plynx.utils.exceptions.RegisterUserException: Missing username