def has_add_permission(self, request):
        sites = Site.objects.values_list('id', flat=True).order_by('id')
        settings = self.model.objects.values_list('site', flat=True).order_by('id')
        for site in sites:
            if site not in settings:
                return True
        return False
dataset/ETHPy150Open mishbahr/django-usersettings2/usersettings/admin.py/SettingsAdmin.has_add_permission/original