@receiver(post_save, sender=Check)
def update_failed_check_flag(sender, instance, **kwargs):
 if (instance.language is None):
  return
 related = get_related_units(instance)
 if (instance.for_unit is not None):
  related = related.exclude(pk=instance.for_unit)
 for unit in related:
  unit.update_has_failing_check(False)

@ receiver ( post_save , sender = Check ) def update_failed_check_flag ( sender , instance , ** kwargs ) : if ( instance . language is None ) : return related = get_related_units ( instance ) if ( instance . for_unit is not None ) : related = related . exclude ( pk = instance . for_unit ) for unit in related : unit . update_has_failing_check ( False )
update related unit failed check flag .