Skip to content

Add conditional to non attemp to create conservation certificate if response was empty #69

@xtornasol512

Description

@xtornasol512

xml_response = connector.generate_proof(new_block.merkleroot)

    xml_response = connector.generate_proof(new_block.merkleroot)
    new_block.data["xml_response"] = xml_response
    # Save
    new_block.save()
    # Save response on a  new table too

    certificate = ConservationCertificate(
        folio=xml_response["Folio"],
        raw_document=xml_response["Constancia"],
        reference=new_block.merkleroot
    )
    certificate.block = new_block
    certificate.data["xml_response"] = xml_response
    certificate.save()
    
This chunk of code must run only once, when the xml_response is not empty!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions