diff --git a/api/src/pcapi/scripts/replace-apostrophe-in-movie-data/main.py b/api/src/pcapi/scripts/replace-apostrophe-in-movie-data/main.py new file mode 100644 index 00000000000..166a2f37903 --- /dev/null +++ b/api/src/pcapi/scripts/replace-apostrophe-in-movie-data/main.py @@ -0,0 +1,16 @@ +from pcapi.app import app +from pcapi.core.categories import subcategories_v2 +from pcapi.core.offers.models import Product +from pcapi.repository import db + + +with app.app_context(): + products = Product.query.filter(Product.subcategoryId == subcategories_v2.SEANCE_CINE.id) + for product in products: + product.description = product.description.replace("'", "\u2019") + if "synopsis" in product.extraData: + product.extraData["synopsis"] = product.extraData["synopsis"].replace("'", "\u2019") + + db.session.add(product) + + db.session.commit()