coderedcorp / coderedcorp/coderedcms
'str' object has no attribute 'method'
- 主要语言
- Python
- 星标
- 765
- 派生
- 154
- PR 合并指标
- 30 天内没有已合并 PR
描述
#### Describe the bug
Form input within 2nd level subpages
#### Steps to reproduce
-Home page already has form input
- If a sub page of the site has a form input, nothing happens
- When a second level sub page (root-page/1st-level-subpage/2nd-level-subpage) has form input, error triggers.
#### Expected behavior
The form input should be displayed and works flawlessly, not caring about if it's 1st, 2nd or so on... level of subpages.
#### Additional context
Exception location: _**page_models.py**_ _line_ _**1356**_ _**(if request.method == 'POST':)**_
```
def get_form(self, request, *args, **kwargs):
form_class = self.get_form_class()
form_params = self.get_form_parameters()
form_params.update(kwargs)
if request.method == 'POST':
return form_class(request.POST, request.FILES, *args, **form_params)
return form_class(*args, **form_params)
```
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 page_models.py 第 1356 行附近开始,在二级子页面上复现表单提交,并将其与主页和一级子页面的情况进行比较。跟踪传递给 get_form 的 request 值,并验证表单在每个页面深度都能显示和正常工作,且不会触发报告中的错误。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- django, python
- 领域
- backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100