gettext() takes 1 positional argument but 2 were given

{% if form_show_errors and field.errors %}
	    {% for error in field.errors %}
	        <p id="error_{{ forloop.counter }}_{{ field.auto_id }}" class="invalid-feedback"><strong>{{ error }}</strong></p>
	    {% endfor %}
	{% endif %}

env\lib\site-packages\crispy_bootstrap5\templates\bootstrap5\layout\field_errors_block.html, error at line 2
it is supposed that is an error in bootstrap what should i do

Please provide the complete traceback that you have received.

In general, this error is caused by passing the wrong data into the translation function - it may be a case of passing a tuple or list where a string is expected. So it become an issue of finding out what all data is involved here.

I see:

What versions of crispy_forms and crispy_bootstrap5 are you using?

What does your sendmail/send_email.html template look like?

What does the form that you are passing to the template in the context look like?

1 Like

sorry the error was from my form code not in bootstrap