monim67 / django-bootstrap-datepicker-plus

Bootstrap3/Bootstrap4/Bootstrap5 DatePickerInput, TimePickerInput, DateTimePickerInput, MonthPickerInput, YearPickerInput with date-range-picker functionality for django >= 2.0
https://pypi.python.org/pypi/django-bootstrap-datepicker-plus
MIT License
223 stars 63 forks source link

Django 4.0 release Dec 7th #68

Closed sroywu closed 2 years ago

sroywu commented 2 years ago

Describe the problem Release notes for django 4.0: https://docs.djangoproject.com/en/4.0/releases/4.0/

I am getting a template rendering error in datepicker:

Exception Type: | TemplateSyntaxError
Invalid block tag on line 1: 'ifnotequal', expected 'empty' or 'endfor'. Did you forget to register or load this tag?

With reference to:

In template /usr/local/lib/python3.8/site-packages/bootstrap_datepicker_plus/templates/bootstrap_datepicker_plus/input.html, error at line 1
<input type="{{ widget.type }}" name="{{ widget.name }}"{% if widget.value != None and widget.value != "" %} value="{{ widget.value }}"{% endif %}{% for name, value in widget.attrs.items %}{% ifnotequal value False %} {{ name }}(...)

The last {% ifnotequal value False %} is the underlined error. Now not sure if there is a problem with datepicker vs a bug in django v4.0 but there doesn't seem to be a change in the release notes of django 4 related to that so it looks like a django 4 bug, not a date picker one. Posting here in case I got it mixed up.

To Reproduce Steps to reproduce the behavior: Switch between django 3 and 4 with a known working page.

Setup Information (please complete the following information):

If it turns out to be a django 4 bug, let me know how I can help report to the django project.

monim67 commented 2 years ago

A new release (version 4.0.0) with the fix has been published.

luigi370 commented 2 years ago

your release does not fix the issue. Check please my MR

monim67 commented 2 years ago

@luigi370 I tested it before release and found it working, can you recheck and verify?