@@ -34,10 +34,6 @@ def __init__(self, description):
34
34
self .description = description
35
35
36
36
37
- # Use this internally, until sentinels are available in the public API.
38
- _UNSPECIFIED = Sentinel ('No value specified' )
39
-
40
-
41
37
DELETE_ATTRIBUTE = Sentinel ('Value used to delete an attribute from a user profile' )
42
38
43
39
@@ -524,9 +520,9 @@ def create_user(self, uid=None, display_name=None, email=None, phone_number=None
524
520
'Failed to create new user.' , http_response = http_resp )
525
521
return body .get ('localId' )
526
522
527
- def update_user (self , uid , display_name = _UNSPECIFIED , email = None , phone_number = _UNSPECIFIED ,
528
- photo_url = _UNSPECIFIED , password = None , disabled = None , email_verified = None ,
529
- valid_since = None , custom_claims = _UNSPECIFIED ):
523
+ def update_user (self , uid , display_name = None , email = None , phone_number = None ,
524
+ photo_url = None , password = None , disabled = None , email_verified = None ,
525
+ valid_since = None , custom_claims = None ):
530
526
"""Updates an existing user account with the specified properties"""
531
527
payload = {
532
528
'localId' : _auth_utils .validate_uid (uid , required = True ),
@@ -538,27 +534,27 @@ def update_user(self, uid, display_name=_UNSPECIFIED, email=None, phone_number=_
538
534
}
539
535
540
536
remove = []
541
- if display_name is not _UNSPECIFIED :
542
- if display_name is None or display_name is DELETE_ATTRIBUTE :
537
+ if display_name is not None :
538
+ if display_name is DELETE_ATTRIBUTE :
543
539
remove .append ('DISPLAY_NAME' )
544
540
else :
545
541
payload ['displayName' ] = _auth_utils .validate_display_name (display_name )
546
- if photo_url is not _UNSPECIFIED :
547
- if photo_url is None or photo_url is DELETE_ATTRIBUTE :
542
+ if photo_url is not None :
543
+ if photo_url is DELETE_ATTRIBUTE :
548
544
remove .append ('PHOTO_URL' )
549
545
else :
550
546
payload ['photoUrl' ] = _auth_utils .validate_photo_url (photo_url )
551
547
if remove :
552
548
payload ['deleteAttribute' ] = remove
553
549
554
- if phone_number is not _UNSPECIFIED :
555
- if phone_number is None or phone_number is DELETE_ATTRIBUTE :
550
+ if phone_number is not None :
551
+ if phone_number is DELETE_ATTRIBUTE :
556
552
payload ['deleteProvider' ] = ['phone' ]
557
553
else :
558
554
payload ['phoneNumber' ] = _auth_utils .validate_phone (phone_number )
559
555
560
- if custom_claims is not _UNSPECIFIED :
561
- if custom_claims is None or custom_claims is DELETE_ATTRIBUTE :
556
+ if custom_claims is not None :
557
+ if custom_claims is DELETE_ATTRIBUTE :
562
558
custom_claims = {}
563
559
json_claims = json .dumps (custom_claims ) if isinstance (
564
560
custom_claims , dict ) else custom_claims
0 commit comments