def upload_file(proofId, fileSource, fileType): proof = get_by_id(proofId=proofId) if proof is None: raise NotFoundException( message="Proof not found associated with the given proofId (proofId=%d)" % proofId, code=MESSAGE_CODE_PROOF_NOT_FOUND ) elif proof.finished is True: raise ForbiddenException( message="No more evidence is accepted for this proof (proofId=%d)" % proofId, code=MESSAGE_CODE_PROOF_NOT_MORE_EVIDENCE_ACCEPTED ) else: file = File.createFromFileSource( fileSource=fileSource, fileType=fileType ) FolderFile.create( folderId=proof.scannedFilesFolderId, fileId=file.fileId ) return proof
def upload_file(proofId, fileSource, fileType): proof = get_by_id(proofId=proofId) if proof is None: raise NotFoundException( "Proof not found associated with the given proofId (proofId=%d)" % proofId) elif proof.finished is True: raise ForbiddenException( "No more evidence is accepted for this proof (proofId=%d)" % proofId) else: file = File.createFromFileSource(fileSource=fileSource, fileType=fileType) FolderFile.create(folderId=proof.scannedFilesFolderId, fileId=file.fileId) return proof
def set_number_of_seats_dataset(self, fileSource): dataset = File.createFromFileSource(fileSource=fileSource) self.numberOfSeatsDatasetId = dataset.fileId
def set_invalid_vote_categories_dataset(self, fileSource): dataset = File.createFromFileSource(fileSource=fileSource) self.invalidVoteCategoriesDatasetId = dataset.fileId
def set_party_candidates_dataset(self, fileSource): dataset = File.createFromFileSource(fileSource=fileSource) self.partyCandidateDatasetId = dataset.fileId
def set_postal_counting_centres_dataset(self, fileSource): dataset = File.createFromFileSource(fileSource=fileSource) self.postalCountingCentresDatasetId = dataset.fileId
def set_polling_stations_dataset(self, fileSource): dataset = File.createFromFileSource(fileSource=fileSource) self.pollingStationsDatasetId = dataset.fileId