<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_groups_on_profile_update(sender, instance, created, *args, **kwargs):
 """ Trigger check when main character or state changes. """

    AutogroupsConfig.objects.update_groups_for_user(instance.user)