diff --git a/epictrack-api/migrations/versions/c3af13f44bed_fix_dispute_resolution_action_.py b/epictrack-api/migrations/versions/c3af13f44bed_fix_dispute_resolution_action_.py new file mode 100644 index 000000000..21874558a --- /dev/null +++ b/epictrack-api/migrations/versions/c3af13f44bed_fix_dispute_resolution_action_.py @@ -0,0 +1,28 @@ +"""fix dispute resolution action configuration + +Revision ID: c3af13f44bed +Revises: 08209ce361c2 +Create Date: 2024-09-05 13:04:27.455776 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'c3af13f44bed' +down_revision = '08209ce361c2' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.execute("UPDATE action_configurations SET is_active = false, is_deleted = true WHERE action_id = 10 AND (additional_params->>'work_type')::int = 15") + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### diff --git a/epictrack-api/src/api/services/event.py b/epictrack-api/src/api/services/event.py index 982ddfbe7..06a9f0847 100644 --- a/epictrack-api/src/api/services/event.py +++ b/epictrack-api/src/api/services/event.py @@ -1134,7 +1134,11 @@ def _process_actions(cls, event: Event, outcome_id: int = None) -> None: action_configurations = ( db.session.query(ActionConfiguration) .join(Action, Action.id == ActionConfiguration.action_id) - .filter(ActionConfiguration.outcome_configuration_id == outcome_id) + .filter( + ActionConfiguration.outcome_configuration_id == outcome_id and + ActionConfiguration.is_active == True and + ActionConfiguration.is_deleted == False + ) .order_by(ActionConfiguration.sort_order) .all() )