`ValueError: min() arg is an empty sequence` as result while using `management.call_command()`

Found the mistake. The arguments where passed in the wrong way. The correct way is:

# account_manager.py

class Command(BaseCommand):
    help = "Menu for all operations around the account managers."

    def handle(self, *args, **options):
        choice = get_app_menu("account manager")

        all_users = UserModel.objects.all()

        if choice == 4:
            call_command("start")
        if choice == 1:
            call_command(
                "account_manager_create",
                all_users[1].id,
                "John",
                "Doe",
                "Management",
            )

No need to specify the arguments, just pass the arguments.

1 Like