コード例 #1
0
ファイル: journalist.py プロジェクト: fowlslegs/securedrop
def bulk_delete(sid, items_selected):
    for item in items_selected:
        item_path = store.path(sid, item.filename)
        worker.enqueue(store.secure_unlink, item_path)
        db_session.delete(item)
    db_session.commit()

    flash("Submission{} deleted.".format("s" if len(items_selected) > 1 else ""), "notification")
    return redirect(url_for("col", sid=sid))
コード例 #2
0
ファイル: journalist.py プロジェクト: pep8er/securedrop
def bulk_delete(sid, items_selected):
    for item in items_selected:
        item_path = store.path(sid, item.filename)
        worker.enqueue(store.secure_unlink, item_path)
        db_session.delete(item)
    db_session.commit()

    flash("Submission{} deleted.".format("s" if len(items_selected) > 1 else ""), "notification")
    return redirect(url_for('col', sid=sid))
コード例 #3
0
ファイル: journalist.py プロジェクト: deadflowers/securedrop
def delete_collection(source_id):
    # Delete the source's collection of submissions
    worker.enqueue(store.delete_source_directory, source_id)

    # Delete the source's reply keypair
    crypto_util.delete_reply_keypair(source_id)

    # Delete their entry in the db
    source = get_source(source_id)
    db_session.delete(source)
    db_session.commit()
コード例 #4
0
ファイル: journalist.py プロジェクト: fowlslegs/securedrop
def delete_collection(source_id):
    # Delete the source's collection of submissions
    worker.enqueue(store.delete_source_directory, source_id)

    # Delete the source's reply keypair
    crypto_util.delete_reply_keypair(source_id)

    # Delete their entry in the db
    source = get_source(source_id)
    db_session.delete(source)
    db_session.commit()
コード例 #5
0
def bulk_delete(filesystem_id, items_selected):
    for item in items_selected:
        item_path = store.path(filesystem_id, item.filename)
        worker.enqueue(srm, item_path)
        db_session.delete(item)
    db_session.commit()

    flash(
        ngettext("Submission deleted.", "Submissions deleted.",
                 len(items_selected)), "notification")
    return redirect(url_for('col.col', filesystem_id=filesystem_id))
コード例 #6
0
ファイル: utils.py プロジェクト: freedomofpress/securedrop
def bulk_delete(filesystem_id, items_selected):
    for item in items_selected:
        item_path = store.path(filesystem_id, item.filename)
        worker.enqueue(srm, item_path)
        db_session.delete(item)
    db_session.commit()

    flash(ngettext("Submission deleted.",
                   "{num} submissions deleted.".format(
                       num=len(items_selected)),
                   len(items_selected)), "notification")
    return redirect(url_for('col.col', filesystem_id=filesystem_id))
コード例 #7
0
ファイル: utils.py プロジェクト: freedomofpress/securedrop
def delete_collection(filesystem_id):
    # Delete the source's collection of submissions
    job = worker.enqueue(srm, store.path(filesystem_id))

    # Delete the source's reply keypair
    crypto_util.delete_reply_keypair(filesystem_id)

    # Delete their entry in the db
    source = get_source(filesystem_id)
    db_session.delete(source)
    db_session.commit()
    return job
コード例 #8
0
ファイル: utils.py プロジェクト: zyphlar/securedrop
def delete_collection(filesystem_id):
    # Delete the source's collection of submissions
    job = worker.enqueue(srm, store.path(filesystem_id))

    # Delete the source's reply keypair
    crypto_util.delete_reply_keypair(filesystem_id)

    # Delete their entry in the db
    source = get_source(filesystem_id)
    db_session.delete(source)
    db_session.commit()
    return job