Skip to content

Commit be86472

Browse files
committed
[fix] Fix unbound local variable: user_model
1 parent 641b384 commit be86472

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

django_saml2_auth/user.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ def create_custom_or_default_jwt(user: Union[str, Type[Model]]):
337337
Optional[str]: JWT token
338338
"""
339339
saml2_auth_settings = settings.SAML2_AUTH
340+
user_model = get_user_model()
341+
340342
custom_create_jwt_trigger = dictor(saml2_auth_settings, "TRIGGER.CUSTOM_CREATE_JWT")
341343

342344
# If user is the id (user_model.USERNAME_FIELD), set it as user_id

0 commit comments

Comments
 (0)