def done_transload(request): request_id = request.REQUEST['request_id'] irequest = InstanceRequest.objects.get(id=request_id) if irequest.user != request.user: return redirect("/") gtfs_file = GtfsFile(instance_request=irequest, transload_url=request.REQUEST['transload_url']) gtfs_file.save() return redirect("/upload?request_id=%s" % request_id)
def done_upload(request): #get the instance request id out of the key key = request.REQUEST['key'] _1, request_id, _2 = key.split("/") irequest = InstanceRequest.objects.get(id=request_id) if irequest.user != request.user: return redirect("/") gtfs_file = GtfsFile(instance_request=irequest, s3_key=key) gtfs_file.save() return redirect("/upload?request_id=%s" % irequest.id)