From 02690af8d64f241bbc2d282c9a7d2708d3bf99f3 Mon Sep 17 00:00:00 2001 From: Mikkel Munch Mortensen <3xm@detfalskested.dk> Date: Thu, 13 Jan 2022 09:45:12 +0100 Subject: [PATCH] Allow zeroes in phone number validation This is embarrassing :) --- cpsms/cpsms.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpsms/cpsms.py b/cpsms/cpsms.py index f6b68d2..b0baf8a 100644 --- a/cpsms/cpsms.py +++ b/cpsms/cpsms.py @@ -107,7 +107,7 @@ class Gateway: raise ValueError("No recipient is set.") # Raise error if recipient is not a number. - pattern = re.compile("^[1-9]+$") + pattern = re.compile("^[0-9]+$") if pattern.match(self.options["to"]) is None: raise ValueError( "Recipient number must be numbers only (no characters, spaces or +)"