<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save_model(self, request, obj, form, change):
 """ Provides a warning if the user is an active admin with no admin access. """

        super(SitePermissionUserAdmin, self).save_model(
            request, obj, form, change)
        user = self.model.objects.get(id=obj.id)
        has_perms = len(user.get_all_permissions()) > 0
        has_sites = SitePermission.objects.filter(user=user).count() > 0
        if user.is_active and user.is_staff and not user.is_superuser and not (
                has_perms and has_sites):
            error(request, "The user is active but won't be able to access "
                           "the admin, due to no edit/site permissions being "
                           "selected")