HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall_forms/buyercall/buyercall/blueprints/api2/doc/utils.py
import logging
import json
import re

from flask import (
    request,
    jsonify)
from datetime import timedelta, datetime
from flask_restx import Resource
from buyercall.blueprints.partnership.models import Partnership, PartnershipAccount

log = logging.getLogger(__name__)


class api_validation:

    def phone_number(self, phonenumber):

        if phonenumber:

            if len(phonenumber) == 12:
                x = re.findall("^(\+)(1)([0-9]{10})", phonenumber)
                if x:
                    return True
        return False