coderedcorp / coderedcorp/coderedcms
'str' object has no attribute 'method'
- Dominant language
- Python
- Stars
- 765
- Forks
- 154
- PR merge metrics
- No merged PRs in 30d
Description
#### 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)
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with page_models.py around line 1356 and reproduce the form submission on a second-level subpage, comparing it with the home page and first-level subpage cases. Trace the value passed as request to get_form and verify that forms display and work at every page depth without triggering the reported error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100