From a2fd25073979ee5da7f6a1cef14fd3367bd76fe4 Mon Sep 17 00:00:00 2001 From: Jose Buitron Date: Mon, 11 Mar 2024 14:59:29 -0500 Subject: [PATCH] fix: Added default value for tests --- terraso_backend/apps/auth/services.py | 2 +- terraso_backend/apps/auth/views.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraso_backend/apps/auth/services.py b/terraso_backend/apps/auth/services.py index 8c952a85e..a41601653 100644 --- a/terraso_backend/apps/auth/services.py +++ b/terraso_backend/apps/auth/services.py @@ -150,7 +150,7 @@ def create_test_access_token(self, user): raise ValueError("User is not a test user") return self.create_token(user, None, {"test": True, "access": True}) - def create_access_token(self, user, created_with_service): + def create_access_token(self, user, created_with_service=None): return self.create_token( user, self.JWT_ACCESS_EXP_DELTA_SECONDS, diff --git a/terraso_backend/apps/auth/views.py b/terraso_backend/apps/auth/views.py index bedfff500..de9bfb6ac 100644 --- a/terraso_backend/apps/auth/views.py +++ b/terraso_backend/apps/auth/views.py @@ -244,7 +244,7 @@ def post(self, request, *args, **kwargs): return HttpResponse("OK", status=200) -def terraso_login(request, user, created_with_service): +def terraso_login(request, user, created_with_service=None): access_token = jwt_service.create_access_token(user, created_with_service) refresh_token = jwt_service.create_refresh_token(user) dj_login(request, user, backend="django.contrib.auth.backends.ModelBackend")