From 95ea4cf98d740d802f12691db57dfb8e29625aa1 Mon Sep 17 00:00:00 2001 From: rizwanisready Date: Tue, 5 Mar 2024 13:29:08 +0530 Subject: [PATCH] corrected principal instance --- accounts/api/views.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/api/views.py b/accounts/api/views.py index ad1fd02..bda2198 100644 --- a/accounts/api/views.py +++ b/accounts/api/views.py @@ -700,13 +700,13 @@ class GoogleLoginAPIView(APIView): email=email, defaults=defaults, ) - + principal_type_instance = IAmPrincipalType.objects.get(name=principal_type) # If newly created, set password if created: print("New Created") default_password = f"GTMES{email[::-1]}" principal.set_password(default_password) - principal.principal_type = principal_type # Assuming principal_type should only be set on creation + principal.principal_type = principal_type_instance # Assuming principal_type should only be set on creation principal.principal_source = google_source principal.save()