Skip to content

Commit 6b09aa8

Browse files
committed
fixing the test case
Signed-off-by: NAYANAR <nayana.r5@ibm.com>
1 parent 0aa6832 commit 6b09aa8

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

mcpgateway/bootstrap_db.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,10 @@ async def bootstrap_admin_user() -> None:
9393
# is reused elsewhere during runtime.
9494
try:
9595
delattr(auth_service, "_skip_password_validation")
96-
except Exception:
97-
pass
96+
except AttributeError:
97+
logger.debug("Temporary attribute '_skip_password_validation' not present on auth_service; nothing to remove")
98+
except Exception as e:
99+
logger.warning(f"Unexpected error removing temporary attribute on auth_service: {e}")
98100

99101
# Mark admin user as email verified and require password change on first login
100102
# First-Party

mcpgateway/services/email_auth_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ async def create_user(self, email: str, password: str, full_name: Optional[str]
289289
full_name: Optional full name for display
290290
is_admin: Whether user has admin privileges
291291
auth_provider: Authentication provider ('local', 'github', etc.)
292+
skip_password_validation: If True, skip strict password policy validation
293+
for this create operation (useful for bootstrap or tests). Defaults
294+
to False.
292295
293296
Returns:
294297
EmailUser: The created user object

0 commit comments

Comments
 (0)