예제 #1
0
    def form_valid(self, form):
        randhex = str(random_word(60))
        analysis_q = AnalysisRequest(handle=form.cleaned_data['handle'],
                                     bucket=randhex)
        analysis_q.description = _('Your request will be handled soon')
        analysis_q.save()

        static = StaticAnalysisParameters(analysis_q)
        start_static_analysis.delay(static)

        return HttpResponseRedirect('/analysis/%s' % analysis_q.id)
예제 #2
0
파일: views.py 프로젝트: yyg192/exodus
    def form_valid(self, form):
        randhex = str(random_word(60))
        req = AnalysisRequest(
            handle=form.cleaned_data['handle'],
            source=form.cleaned_data['source'],
            bucket=randhex,
            description=_('Your request will be handled soon')
        )
        req.save()

        params = StaticAnalysisParameters(req)
        start_static_analysis.delay(params)

        return HttpResponseRedirect(reverse('analysis:wait', args=[req.id]))
예제 #3
0
def upload_file(request):
    if request.method == 'POST' and settings.ALLOW_APK_UPLOAD:
        form = UploadRequestForm(request.POST, request.FILES)
        if form.is_valid():
            req = form.save()
            req.handle = 'from_upload'
            req.bucket = str(random_word(60))
            req.description = _('Your request will be handled soon')
            req.save()

            static = StaticAnalysisParameters(req)
            start_static_analysis.delay(static)
            return HttpResponseRedirect('/analysis/%s' % req.id)
    else:
        form = UploadRequestForm()
    return render(request, 'query_upload.html', {'form': form})