Example #1
0
def db_create_whistleblower_tip(store, internaltip):
    """
    The plaintext receipt is returned only now, and then is
    stored hashed in the WBtip table
    """
    wbtip = models.WhistleblowerTip()

    receipt = unicode(generateRandomReceipt())

    wbtip.receipt_hash = hash_password(receipt,
                                       GLSettings.memory_copy.receipt_salt)
    wbtip.access_counter = 0
    wbtip.internaltip_id = internaltip.id

    store.add(wbtip)

    created_rtips = [
        db_create_receivertip(store, receiver, internaltip)
        for receiver in internaltip.receivers
    ]

    internaltip.new = False

    if len(created_rtips):
        log.debug(
            "The finalized submissions had created %d models.ReceiverTip(s)" %
            len(created_rtips))

    return receipt, wbtip
Example #2
0
def db_create_whistleblowertip(store, internaltip):
    """
    The plaintext receipt is returned only now, and then is
    stored hashed in the WBtip table
    """
    receipt = unicode(generateRandomReceipt())

    wbtip = models.WhistleblowerTip()
    wbtip.id = internaltip.id
    wbtip.receipt_hash = hash_password(receipt, GLSettings.memory_copy.private.receipt_salt)
    store.add(wbtip)

    return receipt, wbtip
Example #3
0
def db_create_whistleblowertip(store, internaltip):
    """
    The plaintext receipt is returned only now, and then is
    stored hashed in the WBtip table
    """
    log.debug("Creating whistleblowertip")

    receipt = unicode(generateRandomReceipt())

    wbtip = models.WhistleblowerTip()
    wbtip.id = internaltip.id
    wbtip.receipt_hash = hash_password(
        receipt, State.tenant_cache[1].private.receipt_salt)
    store.add(wbtip)

    return receipt
def db_create_whistleblower_tip(store, internaltip):
    """
    The plaintext receipt is returned only now, and then is
    stored hashed in the WBtip table
    """
    wbtip = models.WhistleblowerTip()

    receipt = unicode(generateRandomReceipt())

    wbtip.receipt_hash = hash_password(receipt, GLSettings.memory_copy.receipt_salt)
    wbtip.internaltip_id = internaltip.id

    store.add(wbtip)

    created_rtips = [db_create_receivertip(store, receiver, internaltip) for receiver in internaltip.receivers]

    internaltip.new = False

    if len(created_rtips):
        log.debug("The finalized submissions had created %d models.ReceiverTip(s)" % len(created_rtips))

    return receipt, wbtip