We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f9c9e19 commit e50d34bCopy full SHA for e50d34b
shopify/utils/shop_url.py
@@ -10,7 +10,7 @@
10
11
12
def sanitize_shop_domain(shop_domain, myshopify_domain="myshopify.com"):
13
- name = str(shop_domain).lower().strip()
+ name = str(shop_domain or "").lower().strip()
14
if myshopify_domain not in name and "." not in name:
15
name += ".{domain}".format(domain=myshopify_domain)
16
name = re.sub(r"https?://", "", name)
test/utils/shop_url_test.py
@@ -42,3 +42,6 @@ def test_returns_hostname_for_custom_shop_domains(self):
42
]
43
44
self.assertTrue(all(shop == "my-shop.myshopify.io" for shop in sanitized_shops))
45
+
46
+ def test_returns_none_for_none_type(self):
47
+ self.assertIsNone(shop_url.sanitize_shop_domain(None))
0 commit comments