@action(route="/radioepg/gallery/delete/<id>")
@json_only()
@only_orga_admin_user()
def radioep_gallery_delete(request, id):
    """Delete a picture."""

    object = PictureForEPG.query.filter_by(orga=int(request.args.get('ebuio_orgapk')), id=int(id)).first()

    os.unlink(object.filename)

    import glob
    for f in glob.glob((object.id,) % 'media/uploads/radioepg/cache/*_L%s.png'):
        os.unlink(f)

    db.session.delete(object)
    db.session.commit()

    return PlugItRedirect('radioepg/gallery/?deleted=yes')
dataset/ETHPy150Open ebu/radiodns-plugit/RadioDns-PlugIt/radioepg/actions.py/radioep_gallery_delete/swapped operands of `%`