解决方法:将xadmin/plugins/actions.py中的
if django_version > (2, 0): #deletable_objects, model_count, perms_needed, protected = get_deleted_objects( # queryset, self.opts, self.admin_site) using = router.db_for_write(self.model) deletable_objects, model_count, perms_needed, protected = get_deleted_objects( queryset, self.opts, self.user, self.admin_site, using) else: using = router.db_for_write(self.model) deletable_objects, model_count, perms_needed, protected = get_deleted_objects( queryset, self.opts, self.user, self.admin_site, using)
改为
if django_version > (2, 1): deletable_objects, model_count, perms_needed, protected = get_deleted_objects( queryset, self.opts, self.admin_site) # using = router.db_for_write(self.model) # deletable_objects, model_count, perms_needed, protected = get_deleted_objects( # queryset, self.opts, self.user, self.admin_site, using) else: using = router.db_for_write(self.model) deletable_objects, model_count, perms_needed, protected = get_deleted_objects( queryset, self.opts, self.user, self.admin_site, using)