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)
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]))
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})