@@ -450,14 +450,16 @@ class LabelEvent(Enum):
450450PORTAL_TURRET_IMAGE = "https://cloud.githubusercontent.com/assets/1617736/22222924/c07b2a1c-e16d-11e6-91b3-ac659550585c.png" # noqa
451451
452452
453- def parse_commands (body , username , repo_label , repo_cfg , state , my_username ,
454- db , states , * , realtime = False , sha = '' , command_src = '' ):
453+ def parse_commands (body , username , user_id , repo_label , repo_cfg , state ,
454+ my_username , db , states , * , realtime = False , sha = '' ,
455+ command_src = '' ):
455456 global global_cfg
456457 state_changed = False
457458
458459 _reviewer_auth_verified = functools .partial (
459460 verify_auth ,
460461 username ,
462+ user_id ,
461463 repo_label ,
462464 repo_cfg ,
463465 state ,
@@ -468,6 +470,7 @@ def parse_commands(body, username, repo_label, repo_cfg, state, my_username,
468470 _try_auth_verified = functools .partial (
469471 verify_auth ,
470472 username ,
473+ user_id ,
471474 repo_label ,
472475 repo_cfg ,
473476 state ,
@@ -584,8 +587,9 @@ def parse_commands(body, username, repo_label, repo_cfg, state, my_username,
584587 # comment on the pull request if the user is not authorized), we
585588 # need to do the author check BEFORE the verify_auth check.
586589 if state .author != username :
587- if not verify_auth (username , repo_label , repo_cfg , state ,
588- AuthState .REVIEWER , realtime , my_username ):
590+ if not verify_auth (username , user_id , repo_label , repo_cfg ,
591+ state , AuthState .REVIEWER , realtime ,
592+ my_username ):
589593 continue
590594
591595 state .approved_by = ''
@@ -594,7 +598,7 @@ def parse_commands(body, username, repo_label, repo_cfg, state, my_username,
594598 state .change_labels (LabelEvent .REJECTED )
595599
596600 elif command .action == 'prioritize' :
597- if not verify_auth (username , repo_label , repo_cfg , state ,
601+ if not verify_auth (username , user_id , repo_label , repo_cfg , state ,
598602 AuthState .TRY , realtime , my_username ):
599603 continue
600604
@@ -611,7 +615,7 @@ def parse_commands(body, username, repo_label, repo_cfg, state, my_username,
611615 state .save ()
612616
613617 elif command .action == 'delegate' :
614- if not verify_auth (username , repo_label , repo_cfg , state ,
618+ if not verify_auth (username , user_id , repo_label , repo_cfg , state ,
615619 AuthState .REVIEWER , realtime , my_username ):
616620 continue
617621
@@ -1520,6 +1524,7 @@ def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_q
15201524 parse_commands (
15211525 comment .body ,
15221526 comment .user .login ,
1527+ comment .user .id ,
15231528 repo_label ,
15241529 repo_cfg ,
15251530 state ,
@@ -1536,6 +1541,7 @@ def synchronize(repo_label, repo_cfg, logger, gh, states, repos, db, mergeable_q
15361541 parse_commands (
15371542 comment .body ,
15381543 comment .user .login ,
1544+ comment .user .id ,
15391545 repo_label ,
15401546 repo_cfg ,
15411547 state ,
0 commit comments