harbor run -t openthoughts/tasktrove-exp-rpt-issue-issue-0153harbor download openthoughts/tasktrove-exp-rpt-issue-issue-0153Problem description
What you need to implement
Files to modify
Note: You should implement the change without changing any external API or behavior beyond ensuring the in-memory PK is cleared after fast delete.
Before state (pre-fix)
# File: app/django/db/models/deletion.py
class DeletionQuerySet:
def delete(self, instance):
model = instance.__class__
if self.can_fast_delete(instance):
with transaction.mark_for_rollback_on_error():
count = sql.DeleteQuery(model).delete_batch([instance.pk], self.using)
return count, {model._meta.label: count}
with transaction.atomic(using=self.using, savepoint=False):
# slow path: handle dependencies, cascades, etc.
...
What to create/modify in /app/
Modify app/django/db/models/deletion.py
Do not add new public APIs or change existing method signatures. The change is strictly to the in-memory state of the deleted instance.
Expected behavior after the fix
Optional guidance for testing locally
Notes