Skip to content

Commit a423bad

Browse files
committed
include gemini review suggestions
1 parent 6a2aa4e commit a423bad

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

firebase_admin/_user_mgt.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -849,11 +849,14 @@ def generate_email_action_link(
849849
FirebaseError: If an error occurs while generating the link
850850
ValueError: If the provided arguments are invalid
851851
"""
852-
if action_type == 'VERIFY_AND_CHANGE_EMAIL' and not new_email:
852+
if action_type == 'VERIFY_AND_CHANGE_EMAIL':
853+
if not new_email:
854+
raise ValueError(
855+
'new_email must be provided when action_type is VERIFY_AND_CHANGE_EMAIL.')
856+
elif new_email:
853857
raise ValueError(
854-
'new_email must be provided when action_type is VERIFY_AND_CHANGE_EMAIL.'
855-
)
856-
858+
'new_email is only supported for the VERIFY_AND_CHANGE_EMAIL action type.')
859+
857860
payload = {
858861
'requestType': _auth_utils.validate_action_type(action_type),
859862
'email': _auth_utils.validate_email(email, required=True),

0 commit comments

Comments
 (0)