Skip to content

Commit

Permalink
TO REMOVE: fix trigger disabling
Browse files Browse the repository at this point in the history
  • Loading branch information
tconte-pass committed Feb 6, 2025
1 parent 15d41ea commit 79d3d4e
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import sqlalchemy as sa
import time_machine

from pcapi import settings
from pcapi.core.bookings import factories as bookings_factory
from pcapi.core.finance import conf as finance_conf
from pcapi.core.finance import models as finance_models
Expand Down Expand Up @@ -284,15 +283,9 @@ def create_short_email_beneficiaries() -> dict[str, User]:
lastName=fake.last_name(),
needsToFillCulturalSurvey=False,
)
if settings.IS_DEV:
db.session.execute(sa.text("ALTER TABLE booking DISABLE TRIGGER booking_update;"))
else:
db.session.execute(sa.text("SELECT disable_booking_update_trigger();"))
db.session.execute(sa.text("ALTER TABLE booking DISABLE TRIGGER booking_update;"))
bookings_factory.BookingFactory(user=beneficiary_and_exunderage)
if settings.IS_DEV:
db.session.execute(sa.text("ALTER TABLE booking ENABLE TRIGGER booking_update;"))
else:
db.session.execute(sa.text("SELECT enable_booking_update_trigger();"))
db.session.execute(sa.text("ALTER TABLE booking ENABLE TRIGGER booking_update;"))

fraud_factories.BeneficiaryFraudCheckFactory(user=beneficiary_and_exunderage)
users_factories.DepositGrantFactory(user=beneficiary_and_exunderage)
Expand Down

0 comments on commit 79d3d4e

Please sign in to comment.