Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Difficulty Parsing Multiple Arguments in Admin Interface #2

Open
MahdiJafari1 opened this issue Nov 12, 2023 · 1 comment
Open

Difficulty Parsing Multiple Arguments in Admin Interface #2

MahdiJafari1 opened this issue Nov 12, 2023 · 1 comment

Comments

@MahdiJafari1
Copy link

Issue Summary:

When using django-admin-commands2 to run a management command with multiple parameters from the Django admin interface, the command fails to execute correctly. It appears that the single input field provided for arguments (args = forms.CharField(required=False, label=_('Arguments to send to command'))) is not correctly parsing or passing multiple arguments to the management command.

Command Details:

The management command in my project requires two arguments: --from-date (a date string) and --step (an integer). The command is implemented in Django and works as expected when run from the command line.

What I did:

  • Navigate to the Django admin interface where the command is listed.
  • In the provided text field for arguments, enter the arguments in various formats (e.g., --from-date="2021-01-01" --step=5, --from-date "2021-01-01" --step 5, etc.).
  • Execute the command.
  • The command does not run successfully and reports a missing --step argument.

Expected Behavior:

The admin interface should correctly parse and pass multiple arguments to the management command.

Actual Behavior:

The command fails with an error indicating that the --step argument is missing, regardless of how the arguments are formatted in the input field.
Environment:

Django Version: 3.2
django-admin-commands2 Version: 1.1.3
Python Version: 3.9
@RamezIssac
Copy link
Contributor

Thank you for the report.
I will check and feed you back

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants