Add license validity check to login handler
This commit is contained in:
parent
c4044d9131
commit
f1f444b94d
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue