Skip to content

cannot unpack non-iterable NoneType object with SOFT_DELETE_CASCADE #235

Description

@hamidrabedi

I have a parent child model and i want if the parent object got deleted all the children get deleted too (safe delete in my case):

class Review(SafeDeleteModel):
    _safedelete_policy = SOFT_DELETE_CASCADE
    parent = models.ForeignKey(
        'self',
        verbose_name=_("Parent"),
        related_name="children",
        on_delete=models.CASCADE,
        null=True,
        blank=True
    )

and if i delete the parent object this error will be raised:
cannot unpack non-iterable NoneType object
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions