summaryrefslogtreecommitdiff
path: root/src/saml2/client_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/saml2/client_base.py')
-rw-r--r--src/saml2/client_base.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/saml2/client_base.py b/src/saml2/client_base.py
index 564f657e..871f3f2c 100644
--- a/src/saml2/client_base.py
+++ b/src/saml2/client_base.py
@@ -646,8 +646,10 @@ class Base(Entity):
:return:
"""
- # One of them must be present
- assert name_id or base_id or encrypted_id
+ if not name_id and not base_id and not encrypted_id:
+ raise ValueError(
+ "At least one of name_id, base_id or encrypted_id must be present."
+ )
if name_id:
return self._message(NameIDMappingRequest, destination, message_id,