Commit bf847041 authored by matjaz's avatar matjaz

Corrected broken web export_package functionality

parent c971b69b
...@@ -6,7 +6,6 @@ from django.core import serializers ...@@ -6,7 +6,6 @@ from django.core import serializers
from django.utils import simplejson from django.utils import simplejson
from workflows.urls import * from workflows.urls import *
from workflows.helpers import * from workflows.helpers import *
from workflows.management.commands.export_package import Command
import workflows.interaction_views import workflows.interaction_views
import workflows.visualization_views import workflows.visualization_views
import sys import sys
...@@ -1218,9 +1217,14 @@ def export_package(request, packages): ...@@ -1218,9 +1217,14 @@ def export_package(request, packages):
return HttpResponse(status=405) return HttpResponse(status=405)
except: except:
return HttpResponse(status=400) return HttpResponse(status=400)
newuid = request.GET.get('newuid', 'False')=='True' newuid = (request.GET.get('newuid', 'False').lower()=='true' or request.GET.get('n', 'False').lower()=='true')
all = request.GET.get('all', 'False')=='True' all = (request.GET.get('all', 'False').lower()=='true' or request.GET.get('a', 'False').lower()=='true')
packagesArray = packages.split('-') try:
verbosity = int(request.GET.get('v', '1'))
verbosity = int(request.GET.get('verbosity', '1'))
except:
verbosity = 1
packagesArray = tuple(packages.split('-'))
class OutWriter: class OutWriter:
msgs = "" msgs = ""
...@@ -1229,7 +1233,8 @@ def export_package(request, packages): ...@@ -1229,7 +1233,8 @@ def export_package(request, packages):
ov = OutWriter() ov = OutWriter()
result = Command().export_package_string(ov.write, packagesArray, newuid, all) from workflows.management.commands.export_package import export_package_string
result = export_package_string(ov.write, packagesArray, newuid, all, verbosity)
content = '----------------------------------------\n' + \ content = '----------------------------------------\n' + \
'Export procedure message:' +\ 'Export procedure message:' +\
"\n----------------------------------------\n" +\ "\n----------------------------------------\n" +\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment