admin: fix upgrading deletion of tasks when listing

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-06-03 17:42:13 +02:00
parent 5e3628bea6
commit 0eaabbc0f3

View file

@ -37,6 +37,10 @@ class TaskSerializer(PassiveSerializer):
try: try:
return super().to_representation(instance) return super().to_representation(instance)
except AttributeError: except AttributeError:
if isinstance(self.instance, list):
for inst in self.instance:
inst.delete()
else:
self.instance.delete() self.instance.delete()
return {} return {}