geex-arts / django-jet

Modern responsive template for the Django admin interface with improved functionality. We are proud to announce completely new Jet. Please check out Live Demo
https://github.com/jet-admin/jet-bridge
GNU Affero General Public License v3.0
3.58k stars 772 forks source link

Issue with google analytics widget #495

Open SoftDevel97 opened 3 years ago

SoftDevel97 commented 3 years ago

Google analytics widget looks like this in admin page:

Cattura

When I press on the message, this error appears:

Cattura1

The error is in the file "venv/lib/site-packages/django/forms/boundfield.py", in the following function:

def as_widget(self, widget=None, attrs=None, only_initial=False):
          """
          Render the field by rendering the passed widget, adding any HTML
          attributes passed as attrs. If a widget isn't specified, use the
          field's default widget.
          """
          widget = widget or self.field.widget
          if self.field.localize:
              widget.is_localized = True
          attrs = attrs or {}
          attrs = self.build_widget_attrs(attrs, widget)
          if self.auto_id and 'id' not in widget.attrs:
              attrs.setdefault('id', self.html_initial_id if only_initial else self.auto_id)
          return widget.render(
              name=self.html_initial_name if only_initial else self.html_name,
              value=self.value(),
              attrs=attrs,
              renderer=self.form.renderer,
          )

where widget can be TextInput or Textarea from this:

from django.forms.widgets import Textarea, TextInput

However in the file "venv/lib/site-packages/django/forms/widgets.py" the widget class contains this render function which contains renderer as parameter:

  def render(self, name, value, attrs=None, renderer=None):
        """Render the widget as an HTML string."""
        context = self.get_context(name, value, attrs)
        return self._render(self.template_name, context, renderer)

Can anyone help me with this?

KMaina-N commented 8 months ago

I am experiencing the same issue. Does anyone have solution?