Skip to content

Commit

Permalink
Perform validation before ticket creation (#3644) (patch)
Browse files Browse the repository at this point in the history
### Fixed

- order validation is performed before submission.
  • Loading branch information
islean authored Aug 27, 2024
1 parent 9200f2f commit a5b0a7a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cg/meta/orders/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
from cg.apps.osticket import OsTicket
from cg.meta.orders.ticket_handler import TicketHandler
from cg.models.orders.order import OrderIn, OrderType
from cg.services.orders.submitters.order_submitter_registry import OrderSubmitterRegistry
from cg.services.orders.submitters.order_submitter_registry import (
OrderSubmitterRegistry,
)
from cg.store.store import Store

LOG = logging.getLogger(__name__)
Expand Down Expand Up @@ -41,6 +43,7 @@ def submit(self, project: OrderType, order_in: OrderIn, user_name: str, user_mai
Main entry point for the class towards interfaces that implements it.
"""
submit_handler = self.submitter_registry.get_order_submitter(project)
submit_handler.order_validation_service.validate_order(order_in)
# detect manual ticket assignment
ticket_number: str | None = TicketHandler.parse_ticket_number(order_in.name)
if not ticket_number:
Expand Down

0 comments on commit a5b0a7a

Please sign in to comment.