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
1 changed files with 5 additions and 1 deletions

View File

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