Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add url validation for fulfillment tracking number
Przemysław Łada3284672f42b5
diff --git a/saleor/order/models.py b/saleor/order/models.pyindex 5c5caa96b4..0f7420c76f 100644--- a/saleor/order/models.py+++ b/saleor/order/models.py@@ -1,5 +1,6 @@from decimal import Decimalfrom operator import attrgetter+from re import matchfrom typing import Optionalfrom uuid import uuid4@@ -458,6 +459,10 @@ class Fulfillment(ModelWithMetadata):def get_total_quantity(self):return sum([line.quantity for line in self])+ @property+ def is_tracking_number_url(self):+ return bool(match(r"^[-\w]+://", self.tracking_number))+class FulfillmentLine(models.Model):order_line = models.ForeignKey(