'Custom create method allowing us to re-use form logic and distinguish
packaged app from hosted apps, applying delays to the validation task
if necessary.
Doesn\'t rely on any serializer, just forms.'

@use_master
def create(self, request, *args, **kwargs):

    data = self.request.data
    packaged = ('upload' in data)
    form = (NewPackagedForm(data) if packaged else NewManifestForm(data))
    if (not form.is_valid()):
        return Response(form.errors, status=HTTP_400_BAD_REQUEST)
    if (not packaged):
        upload = FileUpload.objects.create(user=(request.user if request.user.is_authenticated() else None))
        tasks.fetch_manifest(form.cleaned_data['manifest'], upload.pk)
    else:
        upload = form.file_upload
        tasks.validator.delay(upload.pk)
    log.info(('Validation    created:    %s' % upload.pk))
    self.kwargs = {'pk': upload.pk}
    upload = self.get_object()
    serializer = self.get_serializer(upload)
    status = (HTTP_201_CREATED if upload.processed else HTTP_202_ACCEPTED)
    return Response(serializer.data, status=status)
