File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -541,18 +541,17 @@ pub(super) async fn handle_command(
541541 }
542542 let db_client = ctx. db . get ( ) . await ;
543543 if is_self_assign ( & name, & event. user ( ) . login ) {
544- match has_user_capacity ( & db_client, & name) . await {
545- Ok ( work_queue) => work_queue. username ,
546- Err ( _) => {
547- issue
548- . post_comment (
549- & ctx. github ,
550- & REVIEWER_HAS_NO_CAPACITY . replace ( "{username}" , & name) ,
551- )
552- . await ?;
553- return Ok ( ( ) ) ;
554- }
555- } ;
544+ let work_queue = has_user_capacity ( & db_client, & name) . await ;
545+ if work_queue. is_err ( ) {
546+ issue
547+ . post_comment (
548+ & ctx. github ,
549+ & REVIEWER_HAS_NO_CAPACITY . replace ( "{username}" , & name) ,
550+ )
551+ . await ?;
552+ return Ok ( ( ) ) ;
553+ }
554+
556555 name. to_string ( )
557556 } else {
558557 let teams = crate :: team_data:: teams ( & ctx. github ) . await ?;
Original file line number Diff line number Diff line change @@ -105,7 +105,6 @@ pub(super) async fn handle_input<'a>(
105105 Ok ( ( ) )
106106}
107107
108- // TODO: we should just fetch the number of assigned prs and max assigned prs. The caller should do the check.
109108pub async fn has_user_capacity (
110109 db : & crate :: db:: PooledClient ,
111110 assignee : & str ,
You can’t perform that action at this time.
0 commit comments