@receiver(post_save, sender=Source)
def update_source(sender, instance, **kwargs):
 related_units = Unit.objects.filter(checksum=instance.checksum, translation__subproject=instance.subproject)
 if instance.priority_modified:
  units = related_units.exclude(priority=instance.priority)
  units.update(priority=instance.priority)
 if instance.check_flags_modified:
  for unit in related_units:
   unit.run_checks()

@ receiver ( post_save , sender = Source ) def update_source ( sender , instance , ** kwargs ) : related_units = Unit . objects . filter ( checksum = instance . checksum , translation__subproject = instance . subproject ) if instance . priority_modified : units = related_units . exclude ( priority = instance . priority ) units . update ( priority = instance . priority ) if instance . check_flags_modified : for unit in related_units : unit . run_checks ( )
updates unit priority or checks based on source change .