File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
readthedocs/oauth/services Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def sync_user_access(cls, user):
159159 queryset = RemoteRepository .objects .filter (
160160 remote_repository_relations__user = user ,
161161 vcs_provider = cls .vcs_provider_slug ,
162- )
162+ ). select_related ( "github_app_installation" )
163163 # Group by github_app_installation, so we don't create multiple clients.
164164 grouped_installations = groupby (
165165 queryset ,
@@ -177,7 +177,9 @@ def sync_user_access(cls, user):
177177 vcs_provider = cls .vcs_provider_slug ,
178178 )
179179 for remote_organization in queryset :
180- remote_repo = remote_organization .repositories .first ()
180+ remote_repo = remote_organization .repositories .select_related (
181+ "github_app_installation"
182+ ).first ()
181183 # NOTE: this should never happen, unless our data is out of sync
182184 # (we delete orphaned organizations when deleting projects).
183185 if not remote_repo :
You can’t perform that action at this time.
0 commit comments