Example #1
0
def import_ctf(path, delete_import_on_finish=False):
    with app.app_context():
        import_ctf_util(path)

    if delete_import_on_finish:
        print(f"Deleting {path}")
        Path(path).unlink()
Example #2
0
def import_ctf():
    backup = request.files['backup']
    errors = get_errors()
    try:
        import_ctf_util(backup)
    except Exception as e:
        print(e)
        errors.append(repr(e))

    if errors:
        return errors[0], 500
    else:
        return redirect(url_for('admin.config'))
Example #3
0
def import_ctf(path):
    with app.app_context():
        import_ctf_util(path)