File tree 3 files changed +247
-76
lines changed 3 files changed +247
-76
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,7 @@ def _get_github_account_target(remote_repository) -> GitHubAccountTarget | None:
214
214
215
215
def _get_projects_missing_migration (user ) -> Iterator [tuple [Project , bool , bool ]]:
216
216
"""
217
- Get all projects where the user has admin permissions that are still connected to the old GitHub OAuth App.
217
+ Get all projects where the user has access that are still connected to the old GitHub OAuth App.
218
218
219
219
Returns an iterator with the project, a boolean indicating if the GitHub App is installed on the repository,
220
220
and a boolean indicating if the user has admin permissions on the repository.
@@ -261,7 +261,7 @@ def get_migrated_projects(user):
261
261
)
262
262
263
263
264
- def get_valid_projects_missing_migration (user ):
264
+ def get_valid_projects_missing_migration (user ) -> Iterator [ Project ] :
265
265
"""
266
266
Get all projects that the user can migrate to the GitHub App.
267
267
@@ -296,6 +296,16 @@ def get_migration_targets(user) -> list[MigrationTarget]:
296
296
return targets
297
297
298
298
299
+ def has_projects_pending_migration (user ) -> bool :
300
+ """
301
+ Check if the user has any projects pending migration to the GitHub App.
302
+
303
+ This includes all projects that are connected to the old GitHub OAuth App,
304
+ where the user has admin permissions and the GitHub App is installed.
305
+ """
306
+ return any (_get_projects_missing_migration (user ))
307
+
308
+
299
309
def get_old_app_link () -> str :
300
310
"""
301
311
Get the link to the old GitHub OAuth App settings page.
You can’t perform that action at this time.
0 commit comments