@@ -28,17 +28,19 @@ def __init__(self, context):
2828 self .api_version = self .input_data .get ("lebesgue_version" , 2 )
2929 self .grouped = self .input_data .get ("grouped" , False )
3030 email = context .remote_profile .get ("email" , None )
31+ phone = context .remote_profile .get ("phone" , None )
3132 username = context .remote_profile .get ("username" , None )
3233 password = context .remote_profile .get ("password" , None )
3334 if email is None and username is not None :
3435 raise DeprecationWarning (
3536 "username is no longer support in current version, "
3637 "please consider use email instead of username."
3738 )
38- if email is None :
39+ if email is None and phone is None :
3940 raise ValueError (
40- "can not find email in remote_profile, please check your machine file."
41+ "can not find email/phone number in remote_profile, please check your machine file."
4142 )
43+
4244 if password is None :
4345 raise ValueError (
4446 "can not find password in remote_profile, please check your machine file."
@@ -47,7 +49,12 @@ def __init__(self, context):
4749 raise DeprecationWarning (
4850 "api version 1 is deprecated. Use version 2 instead."
4951 )
50- self .api = Client (email , password )
52+
53+ account = email
54+ if email is None :
55+ account = phone
56+ self .api = Client (account , password )
57+
5158 self .group_id = None
5259
5360 def gen_script (self , job ):
0 commit comments