Exemplo n.º 1
0
def db_mark_file_for_secure_deletion(session, directory, filename):
    path = os.path.join(directory, filename)
    if not os.path.exists(path):
        return

    secure_file_delete = models.SecureFileDelete()
    secure_file_delete.filepath = path
    session.add(secure_file_delete)
Exemplo n.º 2
0
def db_mark_file_for_secure_deletion(store, relpath):
    abspath = os.path.join(GLSettings.submission_path, relpath)
    if os.path.isfile(abspath):
        secure_file_delete = models.SecureFileDelete()
        secure_file_delete.filepath = abspath
        store.add(secure_file_delete)
    else:
        log.err("Tried to permanently delete a non existent file: %s" % abspath)
Exemplo n.º 3
0
def db_mark_file_for_secure_deletion(session, relpath):
    abspath = os.path.join(Settings.attachments_path, relpath)

    if not os.path.isfile(abspath):
        log.err("Tried to permanently delete a non existent file: %s" % abspath)
        return

    secure_file_delete = models.SecureFileDelete()
    secure_file_delete.filepath = abspath
    session.add(secure_file_delete)
Exemplo n.º 4
0
def db_mark_file_for_secure_deletion(session, directory, filename):
    """
    Transaction for marking a file for secure deletion

    :param session: An ORM session
    :param directory: A path of the directory containing the file
    :param filename: A file name
    """
    path = os.path.join(directory, filename)
    if not os.path.exists(path):
        return

    secure_file_delete = models.SecureFileDelete()
    secure_file_delete.filepath = path
    session.add(secure_file_delete)