From 5a12bcce1cfad8fcf93f902bc9e4c82c4a53ee14 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 12 Feb 2015 23:34:01 +0100 Subject: Add a new reset wizard action available from main templates (refs #2282) --- ishtar_common/views.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'ishtar_common/views.py') diff --git a/ishtar_common/views.py b/ishtar_common/views.py index 1885493b1..7b2fffcef 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -832,6 +832,20 @@ def dashboard_main_detail(request, item_name): return render_to_response('ishtar/dashboards/dashboard_main_detail.html', dct, context_instance=RequestContext(request)) +def reset_wizards(request): + # dynamicaly execute each reset_wizards of each ishtar app + for app in settings.INSTALLED_APPS: + if app == 'ishtar_common': + # no need for infinite recursion + continue + try: + module = __import__(app) + except ImportError: + continue + if hasattr(module, 'views') and hasattr(module.views, 'reset_wizards'): + module.views.reset_wizards(request) + return redirect(reverse('start')) + ITEM_PER_PAGE = 20 def merge_action(model, form, key): def merge(request, page=1): -- cgit v1.2.3