Guard deletion of the GitHub App record account.
Review Request #15194 — Created July 23, 2026 and submitted
Installation accounts reference their hidden app-record account by
primary key stored in JSON data rather than a database foreign key, so
nothing at the database level stops the record from being deleted out
from under them. Deleting it would silently break every installation of
the app, which authenticates using the record's stored credentials.The django admin allows implementing a
get_deleted_objects()method in
order to allow us to prevent this.Testing Done:
Ran unit tests.
- Attempted to delete the app record and saw that it was protected.
- Ran unit tests.
| Summary | ID |
|---|---|
| wmqqtrnulwzukrppwumnnmszmqprzqxp |
| Description | From | Last Updated |
|---|---|---|
|
Django-stubs types this as Sequence[... | None], so we might need to handle this case. |
|
|
|
This wraps weirdly. Can we just query for the objects above and then pass that in here? |
|
|
|
Can we use the normal multi-line form here? |
|
|
|
Can you put this in parens or indent to better indicate these aren't two things in the conditional? |
|
|
|
We shouldn't have to type this. |
|
|
|
Can we alphabetize these? |
|
|
|
Can we alphabetize these? |
|
|
|
Can we alphabetize these? |
|
|
|
Can we alphabetize these? |
|
|
|
Can we alphabetize these? |
|
|
|
'collections.abc.Sequence' imported but unused Column: 5 Error code: F401 |
|
|
|
'typing.ClassVar' imported but unused Column: 5 Error code: F401 |
|