diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-17 18:31:52 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-01-17 18:31:52 +0100 |
commit | 8d842efb12ee7db88505e3078b626855e55aa4bf (patch) | |
tree | 54670c428b961f299ec10dd91255f8f17333f7d5 /module/web/ajax | |
parent | Fixed Shareonline (diff) | |
download | pyload-8d842efb12ee7db88505e3078b626855e55aa4bf.tar.xz |
some fixes, closed #62 ??
Diffstat (limited to 'module/web/ajax')
-rw-r--r-- | module/web/ajax/urls.py | 1 | ||||
-rw-r--r-- | module/web/ajax/views.py | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/module/web/ajax/urls.py b/module/web/ajax/urls.py index 4decc27b1..7d63ef5a6 100644 --- a/module/web/ajax/urls.py +++ b/module/web/ajax/urls.py @@ -18,6 +18,7 @@ urlpatterns = patterns('ajax', (r'^queue$', 'views.queue'), (r'^pause$', 'views.pause'), (r'^unpause$', 'views.unpause'), + (r'^cancel$', 'views.cancel'), (r'^packages$', 'views.packages'), (r'^package/(\d+)$', 'views.package'), (r'^link/(\d+)$', 'views.link'), diff --git a/module/web/ajax/views.py b/module/web/ajax/views.py index ea092745f..4f136cef9 100644 --- a/module/web/ajax/views.py +++ b/module/web/ajax/views.py @@ -30,7 +30,7 @@ class JsonResponse(HttpResponse): object, indent=2, cls=json.DjangoJSONEncoder, ensure_ascii=False) super(JsonResponse, self).__init__( - content, content_type='application/json') #@TODO uncomment + content)#, content_type='application/json') #@TODO uncomment self['Cache-Control'] = 'no-cache, must-revalidate' @@ -117,6 +117,12 @@ def unpause(request): return HttpResponseServerError() +@permission('pyload.can_change_status') +def cancel(request): + try: + return JsonResponse(settings.PYLOAD.stop_downloads()) + except: + return HttpResponseServerError() @permission('pyload.can_see_dl') def packages(request): |