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
from django.utils import simplejson
from workflows.urls import *
from workflows.helpers import *
from workflows.management.commands.export_package import Command
import workflows.interaction_views
import workflows.visualization_views
import sys
......@@ -1218,9 +1217,14 @@ def export_package(request, packages):
return HttpResponse(status=405)
except:
return HttpResponse(status=400)
newuid = request.GET.get('newuid', 'False')=='True'
all = request.GET.get('all', 'False')=='True'
packagesArray = packages.split('-')
newuid = (request.GET.get('newuid', 'False').lower()=='true' or request.GET.get('n', 'False').lower()=='true')
all = (request.GET.get('all', 'False').lower()=='true' or request.GET.get('a', 'False').lower()=='true')
try:
verbosity = int(request.GET.get('v', '1'))
verbosity = int(request.GET.get('verbosity', '1'))
except:
verbosity = 1
packagesArray = tuple(packages.split('-'))
class OutWriter:
msgs = ""
......@@ -1229,7 +1233,8 @@ def export_package(request, packages):
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' + \
'Export procedure message:' +\
"\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