small refactor in as_operations to prepare for m2m

This commit is contained in:
Laura Klünder 2024-11-22 20:00:17 +01:00
parent 5474ff6ae5
commit 8a9ab6396f

View file

@ -589,13 +589,15 @@ class ChangedObjectCollection(BaseSchema):
ended_situations.append(situation)
if done_situation:
result = DatabaseOperationCollection(
prev=self.prev,
)
result.extend(done_situation.operations)
return result
operations = done_situation.operations
else:
# todo: what to do if we can't fully solve it?
raise NotImplementedError('couldnt fully solve as_operations')
# todo: m2m
# todo: what to do if we can't fully solve it?
raise NotImplementedError('couldnt fully solve as_operations')
result = DatabaseOperationCollection(
prev=self.prev,
)
result.extend(operations)
return result