corrected principal instance

This commit is contained in:
rizwanisready
2024-03-05 13:29:08 +05:30
parent dd0c2ef254
commit 95ea4cf98d

View File

@@ -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()