Deleted/Archived group project templates are still available for new projects

Summary

After deleting a project from a group project templates subgroup, it is still available for use when creating a new project. This may only affect soft-deleted projects that are pending removal.

Steps to reproduce

  1. Set up subgroup for group project templates
  2. Create a template project
  3. Archive/Remove it
  4. Create a new project from template.

Example Project / Current Behaviour

Template subgroup listing active project(s)

image

New Project from Template shows a soft-deleted/archived project pending removal

image

The example project that should no longer be available for use (Delete still pending due to #212645 (closed))

Project ID: 15354176 image

What is the expected correct behavior?

Deleted/Archived project should no longer be usable as template.

Output of checks

This bug happens on GitLab.com