Hi Salima, Stack trace? Always the first call for triage on python exceptions.
Also (and unrelated to your issue) google "django messages bootstrap" and check on how to avoid the {% if message.tags == .. %} horror show and make your templates much more readable/easily maintained. On Mon, Sep 20, 2021 at 1:52 PM Salima Begum <salim...@rohteksolutions.com> wrote: > Hi all, > > > Our web application prompts confirmation messages when user submits the > form and users can continue to submit additional forms while they are using > application and the confirmation messages are prompted fine, but 'str' > object is not callable error appears randomly before prompting a > confirmation message and once this error starts appearing it will continue > to appear for any form submission. During our testing we observed that this > issue is happening in Django version 3.2.7 (ubuntu 20.x), but it is not > reproducible in Django version 3.1.6 (windows10). So, we think that this > could be a bug in version 3.2.7 . We made sure our code by following this > page. > > https://docs.djangoproject.com/en/3.2/ref/contrib/messages/ > > In views.py : > > {{{ > messages.success(request, "Item is successfully removed.") > }}} > > > In template: > > {{{ > {% for message in messages %} > <div class = "conf_body"> > <div class="alert alert-{% if message.tags == 'error' > %}danger{% else %}{{ message.tags }}{% endif %} success-alert flex-row"> > <a class="close close_conf" href="#" data-dismiss="alert" > style="">×</a> > {% if message.tags == 'error' %} > <i style="color:red;" class="fa fa-exclamation-circle > circle_post" > aria-hidden="true"></i> > <span class = "conf_text" style="color:red;" > class="text_post">{{ message|safe }} </span> > {% else %} > <i style="color:#01ABAA;" class="fa fa-check-circle > circle_post " aria-hidden="true"> </i> > <span class = "conf_text" > style="color:#01ABAA;"> {{ message|safe > }}</span> > {% endif %} > </div> > </div> > {% endfor %} > }}} > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAMSz6b%3DJ2OLkOiwpRw2h6H48x6ELb61REWM%3Dj913pssxBZsrhA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAMSz6b%3DJ2OLkOiwpRw2h6H48x6ELb61REWM%3Dj913pssxBZsrhA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAE5VhgXBXzrEf1PNWbPqAjRLbj04gW8LoVkR5maZ%3D_8fKiF3Aw%40mail.gmail.com.