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

Home Page:https://github.com/jet-admin/jet-bridge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issue with google analytics widget

SoftDevel97 opened this issue · comments

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?

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