手机号校验bug
This commit is contained in:
parent
236c796d0a
commit
1222b7be76
|
@ -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)
|
res = loc_change(data=data)
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
@ -267,18 +268,17 @@ class TestViewSet(CustomGenericViewSet):
|
||||||
res = handle_xx_event(name='one_key_alarm', data=data)
|
res = handle_xx_event(name='one_key_alarm', data=data)
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, serializer_class=Serializer)
|
@action(methods=['post'], detail=False, serializer_class=Serializer)
|
||||||
def test_rail_in(self, request, pk=None):
|
def test_rail_in(self, request, pk=None):
|
||||||
"""测试围栏进入
|
"""测试围栏进入
|
||||||
|
|
||||||
测试围栏进入
|
测试围栏进入
|
||||||
"""
|
"""
|
||||||
data = {'railId': '80fe94bff7b240aa893976965197487c', 'userId': '1918B20019F5',"railName":"二道门",
|
data = {'railId': '80fe94bff7b240aa893976965197487c', 'userId': '1918B20019F5', "railName": "二道门",
|
||||||
'time': 1663067822887, "type":1, "buildId": "204878", "floorNo":"Floor1"}
|
'time': 1663067822887, "type": 1, "buildId": "204878", "floorNo": "Floor1"}
|
||||||
res = rail_in(data=data)
|
res = rail_in(data=data)
|
||||||
return Response(res)
|
return Response(res)
|
||||||
|
|
||||||
@action(methods=['post'], detail=False, serializer_class=AreaManSerializer)
|
@action(methods=['post'], detail=False, serializer_class=AreaManSerializer)
|
||||||
def test_area_man(self, request, pk=None):
|
def test_area_man(self, request, pk=None):
|
||||||
"""测试区域超员/缺员事件
|
"""测试区域超员/缺员事件
|
||||||
|
@ -288,6 +288,10 @@ class TestViewSet(CustomGenericViewSet):
|
||||||
res = update_count_people(i=Area.objects.get(id=request.data['area']))
|
res = update_count_people(i=Area.objects.get(id=request.data['area']))
|
||||||
return Response(res)
|
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)
|
@action(methods=['post'], detail=False, serializer_class=Serializer)
|
||||||
def test_not_in_place(self, request, pk=None):
|
def test_not_in_place(self, request, pk=None):
|
||||||
check_not_in_place(Opl.objects.get(id='1568880208688320512'))
|
check_not_in_place(Opl.objects.get(id='1568880208688320512'))
|
||||||
|
|
|
@ -171,7 +171,7 @@ def check_id_number(idcard):
|
||||||
|
|
||||||
|
|
||||||
def check_phone_e(phone):
|
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):
|
if not re.match(re_phone, phone):
|
||||||
raise ValidationError('手机号格式错误')
|
raise ValidationError('手机号格式错误')
|
||||||
return phone
|
return phone
|
||||||
|
|
Loading…
Reference in New Issue