django - <class 'astromatchapp.report.admin.user.ReportUserAdmin'> 中定义的 Action 的 __name__ 属性必须是唯一的

标签 django python-3.x

ERRORS:
<class 'astromatchapp.report.admin.user.ReportUserAdmin'>: (admin.E130) __name__ attributes of actions defined in <class 'astromatchapp.report.admin.user.ReportUserAdmin'> must be unique.
<class 'astromatchapp.web.admin.user.UserAdmin'>: (admin.E130) __name__ attributes of actions defined in <class 'astromatchapp.web.admin.user.UserAdmin'> must be unique.
?: (urls.E007) The custom handler404 view 'astromatchapp.web.views.http_error.handler404' does not take the correct number of arguments (request, exception).

迁移到我的 manage.py 后生成了这个错误。

最佳答案

这似乎在 Django 2.2 中被破坏了。

Ticket 29917讨论了这个(意见不一),虽然它被标记为已修复,但问题仍然存在。

我的观察表明,实际功能代码中没有任何问题(操作确实有效,并且不会在继承的 ModelAdmin 类上收集两次)。只是试图太聪明的嘈杂警告。

您可以通过将其添加到您的设置中来简单地禁用它:

SILENCED_SYSTEM_CHECKS = ['admin.E130']

关于django - <class 'astromatchapp.report.admin.user.ReportUserAdmin'> 中定义的 Action 的 __name__ 属性必须是唯一的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58502493/

相关文章:

python - 我可以用 python 列表过滤 django 模型吗?

python - DRF形式渲染对象属性(名称)而不是对象

python - __getattr__ 在模块上

python - 如何在 Python 中获得相同的输出示例?

django-hvad - 我应该如何在保存模型实例时设置翻译字段值?

javascript - 如何在 Django 应用程序中的 Javascript、Python 和 CSS 之间共享配置数据?

python - 在 pdf weasyprint 中附加 img 文件

python-3.x - 简化 numpy 表达式

python - 根据频率,用列中的随机值填充 DataFrame 的 NaN 值

python - 理解字符串的真实性