From f7858a20b7c7165908240aaa2ada4278b17260db Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Mon, 28 Dec 2020 17:46:20 +0200 Subject: [PATCH] Fix user creation. --- django_etebase/utils.py | 2 +- etebase_fastapi/authentication.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/django_etebase/utils.py b/django_etebase/utils.py index e46cbd0..4d36a94 100644 --- a/django_etebase/utils.py +++ b/django_etebase/utils.py @@ -28,7 +28,7 @@ def get_user_queryset(queryset, context: CallbackContext): def create_user(context: CallbackContext, *args, **kwargs): custom_func = app_settings.CREATE_USER_FUNC if custom_func is not None: - return custom_func(*args, **kwargs) + return custom_func(context, *args, **kwargs) return User.objects.create_user(*args, **kwargs) diff --git a/etebase_fastapi/authentication.py b/etebase_fastapi/authentication.py index 559a60a..fe522f7 100644 --- a/etebase_fastapi/authentication.py +++ b/etebase_fastapi/authentication.py @@ -181,7 +181,7 @@ async def is_etebase(): @authentication_router.post("/login_challenge/", response_model=LoginChallengeOut) -async def login_challenge(user: User = Depends(get_login_user)): +def login_challenge(user: User = Depends(get_login_user)): salt = bytes(user.userinfo.salt) enc_key = get_encryption_key(salt) box = nacl.secret.SecretBox(enc_key) @@ -238,10 +238,10 @@ def signup_save(data: SignupIn, request: Request) -> User: # Create the user and save the casing the user chose as the first name try: instance = create_user( + CallbackContext(request.path_params), **user_data.dict(), password=None, first_name=user_data.username, - context=CallbackContext(request.path_params), ) instance.full_clean() except HttpError as e: