summaryrefslogtreecommitdiffstats
path: root/module/web/ajax/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/ajax/views.py')
-rw-r--r--module/web/ajax/views.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py
index 603bb993a..f90052b62 100644
--- a/module/web/ajax/views.py
+++ b/module/web/ajax/views.py
@@ -53,10 +53,9 @@ class JsonResponse(HttpResponse):
def add_package(request):
name = request.POST['add_name']
-
queue = int(request.POST['add_dest'])
-
links = request.POST['add_links'].split("\n")
+ pw = request.POST.get("add_password", "").strip("\n\r")
try:
f = request.FILES['add_file']
@@ -79,8 +78,10 @@ def add_package(request):
links = map(lambda x: x.strip(), links)
links = filter(lambda x: x != "", links)
-
- settings.PYLOAD.add_package(name, links, queue)
+ pack = settings.PYLOAD.add_package(name, links, queue)
+ if pw:
+ data = {"password": pw}
+ settings.PYLOAD.set_package_data(pack, data)
return JsonResponse("success")