django-bootstrap-datepicker-plus icon indicating copy to clipboard operation
django-bootstrap-datepicker-plus copied to clipboard

MEDIA is called twice

Open andytwoods opened this issue 4 years ago • 0 comments

Hi, I load manually load CSS and JS in my template for my ModelForm DateTime field. I dont load in {{ form.media.js }} as this is already loaded.

The form works fine. But I get this error Uncaught TypeError: Cannot read property 'Constructor' of undefined

Examination of html reveals that this JS and CSS is called, in MEDIA: https://github.com/monim67/django-bootstrap-datepicker-plus/blob/91400a3f80546eb046536e902f6825bdfd2f0836/bootstrap_datepicker_plus/_base.py#L50. Manually deleting that CSS and JS removes the console error. Note that the form still works (as I manually add ncessary css and js).

Is there a setting for me to prevent MEDIA js and css being loaded? I've failed to google on this.

With many thanks, Andy.

andytwoods avatar Sep 07 '20 07:09 andytwoods