def get_context_data(self, **kwargs): context = super(PricingView, self).get_context_data(**kwargs) if self.edit_perm: context.update({'plan': Plan()}) if not self.object_list.exists(): messages.info( self.request, _("No Plans yet. Click the 'Add Plan' button to create one." )) return context
def get_context_data(self, **kwargs): context = super(PricingView, self).get_context_data(**kwargs) if self.edit_perm: app = get_current_app() if app.show_edit_tools: context.update({ 'show_show_edit_tools': app.show_edit_tools, 'plan': Plan() }) if not self.object_list.exists(): messages.info(self.request, _("No Plans yet."\ " Click the 'Add Plan' button to create one.")) return context