Add license validity check to login handler

This commit is contained in:
Ramon Wenger 2023-08-16 14:49:51 +02:00
parent c4044d9131
commit f1f444b94d
1 changed files with 4 additions and 1 deletions

View File

@ -21,6 +21,9 @@ def handle_user_and_verify_products(user_data, token):
license = License.objects.get_active_license_for_user(user)
if license and not license.is_valid():
license = None
if not license:
license, error_msg = check_and_create_licenses(hep_client, user, token)
@ -29,7 +32,7 @@ def handle_user_and_verify_products(user_data, token):
create_role_for_user(user, license.for_role.key)
if not license.is_valid():
if license and not license.is_valid():
return user, NO_VALID_LICENSE
return user, None