admin: fix upgrading deletion of tasks when listing
Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
5e3628bea6
commit
0eaabbc0f3
|
@ -37,7 +37,11 @@ class TaskSerializer(PassiveSerializer):
|
||||||
try:
|
try:
|
||||||
return super().to_representation(instance)
|
return super().to_representation(instance)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
self.instance.delete()
|
if isinstance(self.instance, list):
|
||||||
|
for inst in self.instance:
|
||||||
|
inst.delete()
|
||||||
|
else:
|
||||||
|
self.instance.delete()
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in New Issue