def METHOD_NAME(*, draft, updates):
    new_codeset = draft.codeset.update(updates)
    status_to_new_code = defaultdict(list)
    for code, status in new_codeset.code_to_status.items():
        status_to_new_code[status].append(code)
    for status, codes in status_to_new_code.items():
        draft.code_objs.filter(code__in=codes).update(status=status)
    logger.info("Updated code statuses", draft_pk=draft.pk)