@receiver(post_delete, sender=Suggestion)
@receiver(post_save, sender=Suggestion)
def update_suggestion_flag(sender, instance, **kwargs):
 for unit in get_related_units(instance):
  unit.update_has_suggestion()

@ receiver ( post_delete , sender = Suggestion ) @ receiver ( post_save , sender = Suggestion ) def update_suggestion_flag ( sender , instance , ** kwargs ) : for unit in get_related_units ( instance ) : unit . update_has_suggestion ( )
update related unit suggestion flags .