Skip to content

Commit

Permalink
fix invitations command optional argument
Browse files Browse the repository at this point in the history
  • Loading branch information
giancarloromeo committed Aug 15, 2024
1 parent 248e192 commit 00048e4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/web/server/src/simcore_service_webserver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import logging
import os
from typing import Final

import typer
from aiohttp import web
Expand Down Expand Up @@ -82,20 +83,22 @@ async def app_factory() -> web.Application:
create_settings_command(settings_cls=ApplicationSettings, logger=_logger)
)

_NO_TRIAL_DAYS: Final[int] = -1


@main.command()
def invitations(
base_url: str,
issuer_email: str,
trial_days: Annotated[int | None, typer.Argument()] = None,
trial_days: Annotated[int, typer.Argument()] = _NO_TRIAL_DAYS,
user_id: int = 1,
num_codes: int = 15,
code_length: int = 30,
):
login_cli.invitations(
base_url=base_url,
issuer_email=issuer_email,
trial_days=trial_days,
trial_days=trial_days if trial_days != _NO_TRIAL_DAYS else None,
user_id=user_id,
num_codes=num_codes,
code_length=code_length,
Expand Down

0 comments on commit 00048e4

Please sign in to comment.