def settings_report_enable(request, plugin_name): # only do this if there isn't a plugin already with the name try: plugin = Report.objects.get(name=plugin_name) except Report.DoesNotExist: plugin = Report(name=plugin_name) plugin.save() return redirect('settings_reports')
def plugin_enable(request, plugin_name): # only do this if there isn't a plugin already with the name try: plugin = Plugin.objects.get(name=plugin_name) except Plugin.DoesNotExist: plugin = Plugin(name=plugin_name, order=utils.unique_plugin_order()) plugin.save() return redirect('plugins_page')