Merge branch 'bug-600422-oauth_upload'

This commit is contained in:
Piotr Zalewa 2011-08-22 22:14:40 +01:00
Родитель 17dabfc328 a5b8229612
Коммит 460c8f1f15
1 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -1,7 +1,7 @@
import commonware.log
from django.shortcuts import render_to_response
from django.http import HttpResponse
from django.http import HttpResponse, HttpResponseNotAllowed, HttpResponseBadRequest
from amo import tasks
from jetpack.models import (PackageRevision,
@ -26,7 +26,7 @@ def upload_to_amo(request, pk):
if len(uploaded) > 0:
log.debug("This Add-on was already uploaded using version \"%s\"" % version)
log.debug(revision.amo_status)
raise SimpleException("This Add-on was already uploaded using version \"%s\"" % version)
return HttpResponseBadRequest("This Add-on was already uploaded using version \"%s\"" % version)
try:
PackageRevision.objects.get(
package=revision.package, amo_version_name=version,
@ -35,6 +35,6 @@ def upload_to_amo(request, pk):
pass
else:
log.debug("This Add-on is currently scheduled to upload")
raise SimpleException("This Add-on is currently scheduled to upload")
return HttpResponseBadRequest("This Add-on is currently scheduled to upload")
tasks.upload_to_amo.delay(pk)
return HttpResponse('{"delayed": true}')