Skip to content

add renderer=None to Credential Widget #522

Description

@Tauhid-Ahmed8009

in jet/dashboard/dashboard_modules/google_analytics.py
add renderer=None

class CredentialWidget(Widget):
module = None

def render(self, name, value, attrs=None, **renderer=None**):
    if value and len(value) > 0:
        link = '<a href="%s">%s</a>' % (
            reverse('jet-dashboard:google-analytics-revoke', kwargs={'pk': self.module.model.pk}),
            force_str(_('Revoke access'))
        )
    else:
        link = '<a href="%s">%s</a>' % (
            reverse('jet-dashboard:google-analytics-grant', kwargs={'pk': self.module.model.pk}),
            force_str(_('Grant access'))
        )

    attrs = self.build_attrs({
        'type': 'hidden',
        'name': 'credential',
    })
    attrs['value'] = force_unicode(value) if value else ''

    return format_html('%s<input{} />' % link, flatatt(attrs))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions