def save_related(self, request, form, formsets, change):

        instance = form.instance

        teams_before_save = [team.id for team in instance.team_set.all()]
        LOG.debug("teams for user %s before save: %s" %
                  (instance, teams_before_save))
        super(UserAdmin, self).save_related(request, form, formsets, change)
        teams_after_save = [team.id for team in instance.team_set.all()]
        LOG.debug("teams for user %s after save: %s" %
                  (instance, teams_after_save))

        if cmp(teams_before_save, teams_after_save):
            email_notifications.notify_team_change_for(user=instance)
An avatar is created from an image file.
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/account/admin/user.py/UserAdmin.save_related--crossover with--dataset/ETHPy150Open mozilla/kitsune/kitsune/upload/tests/test_tasks.py/CreateThumbnailTestCase.test_create_image_thumbnail_avatar