def get_notifications(self, request): if is_telemetry_enabled() and is_in_grace_period() and not is_opt_out(): yield Notification( _("Statistics will be periodically sent to Shuup.com after 24 hours. Click here for more information."), title=_("Telemetry"), kind="info", url="shuup_admin:telemetry" )
def get_context_data(self, **kwargs): context = super(TelemetryView, self).get_context_data(**kwargs) context.update({ "opt_in": not telemetry.is_opt_out(), "is_grace": telemetry.is_in_grace_period(), "last_submission_time": telemetry.get_last_submission_time(), "submission_data": telemetry.get_telemetry_data(request=self.request, indent=2), "title": _("Telemetry") }) return context
def get_form_defs(self): form_defs = [] context = { "opt_in": not telemetry.is_opt_out(), "is_grace": telemetry.is_in_grace_period(), "last_submission_time": telemetry.get_last_submission_time(), "submission_data": telemetry.get_telemetry_data(request=self.request, indent=2), "title": _("Telemetry") } form_defs.append( TemplatedWizardFormDef( name=self.identifier, template_name="shuup/admin/system/telemetry_wizard.jinja", form_class=TelemetryWizardForm, context=context, kwargs={"shop": self.object} ) ) return form_defs