@@ -2,9 +2,6 @@ use bon::Builder;
2
2
use diesel:: prelude:: * ;
3
3
use diesel_async:: { AsyncPgConnection , RunQueryDsl } ;
4
4
5
- use crates_io_github:: { GitHubClient , GitHubError } ;
6
- use oauth2:: AccessToken ;
7
-
8
5
use crate :: models:: { Crate , CrateOwner , Owner , OwnerKind } ;
9
6
use crate :: schema:: { crate_owners, teams} ;
10
7
@@ -54,22 +51,6 @@ impl NewTeam<'_> {
54
51
}
55
52
56
53
impl Team {
57
- /// Phones home to Github to ask if this User is a member of the given team.
58
- /// Note that we're assuming that the given user is the one interested in
59
- /// the answer. If this is not the case, then we could accidentally leak
60
- /// private membership information here.
61
- pub async fn contains_user (
62
- & self ,
63
- gh_client : & dyn GitHubClient ,
64
- gh_login : & str ,
65
- token : & AccessToken ,
66
- ) -> Result < bool , GitHubError > {
67
- Ok ( gh_client
68
- . team_membership ( self . org_id , self . github_id , gh_login, token)
69
- . await ?
70
- . is_some_and ( |m| m. is_active ( ) ) )
71
- }
72
-
73
54
pub async fn owning ( krate : & Crate , conn : & mut AsyncPgConnection ) -> QueryResult < Vec < Owner > > {
74
55
let base_query = CrateOwner :: belonging_to ( krate) . filter ( crate_owners:: deleted. eq ( false ) ) ;
75
56
let teams = base_query
0 commit comments