<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def next(self, task):
 """ Find the next task :param kser.sequencing.task.Task task: previous task :return: The next task :rtype: kser.sequencing.task.Task or None """

        uuid = str(task.uuid)
        for idx, otask in enumerate(self.tasks[:-1]):
            if otask.uuid == uuid:
                if self.tasks[idx + 1].status != 'SUCCESS':
                    return self.tasks[idx + 1]
                else:
                    uuid = self.tasks[idx + 1].uuid