手机号校验bug

This commit is contained in:
曹前明 2022-09-21 18:25:28 +08:00
parent 236c796d0a
commit 1222b7be76
2 changed files with 10 additions and 6 deletions

View File

@ -252,7 +252,8 @@ class TestViewSet(CustomGenericViewSet):
位置信息改变
"""
data = {'buildId': '204878', 'floorNo': 'Floor1', 'userId': '1918B2001A26', 'timestampMillisecond': 1663749630302, 'xMillimeter': 314364, 'yMillimeter': 362752, 'zMillimeter': 0, 'pointProperties': 0, 'locationType': 1, 'status': 0, 'src': 0, 'longitude': 114.63020038067505, 'latitude': 38.81357371331778}
data = {'buildId': '204878', 'floorNo': 'Floor1', 'userId': '1918B2001A26', 'timestampMillisecond': 1663749630302, 'xMillimeter': 314364, 'yMillimeter': 362752,
'zMillimeter': 0, 'pointProperties': 0, 'locationType': 1, 'status': 0, 'src': 0, 'longitude': 114.63020038067505, 'latitude': 38.81357371331778}
res = loc_change(data=data)
return Response(res)
@ -267,7 +268,6 @@ class TestViewSet(CustomGenericViewSet):
res = handle_xx_event(name='one_key_alarm', data=data)
return Response(res)
@action(methods=['post'], detail=False, serializer_class=Serializer)
def test_rail_in(self, request, pk=None):
"""测试围栏进入
@ -288,6 +288,10 @@ class TestViewSet(CustomGenericViewSet):
res = update_count_people(i=Area.objects.get(id=request.data['area']))
return Response(res)
@action(methods=['post'], detail=False, serializer_class=Serializer)
def correct_rail(self, request, pk=None):
pass
@action(methods=['post'], detail=False, serializer_class=Serializer)
def test_not_in_place(self, request, pk=None):
check_not_in_place(Opl.objects.get(id='1568880208688320512'))

View File

@ -171,7 +171,7 @@ def check_id_number(idcard):
def check_phone_e(phone):
re_phone = r'/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/'
re_phone = r'^((13[0-9])|(14(0|[5-7]|9))|(15([0-3]|[5-9]))|(16(2|[5-7]))|(17[0-8])|(18[0-9])|(19([0-3]|[5-9])))\\d{8}$'
if not re.match(re_phone, phone):
raise ValidationError('手机号格式错误')
return phone