def get_previous_state(instance, state): history = getReviewHistory(instance, reverse=True) history = map(lambda event: event["review_state"], history) for status in history: if status != state: return status return None
def getVerificators(self): """Returns the user ids of the users that verified this analysis """ verifiers = list() actions = ["verify", "multi_verify"] for event in wf.getReviewHistory(self): if event['action'] in actions: verifiers.append(event['actor']) sorted(verifiers, reverse=True) return verifiers