#35720: Problem with getattr Handling in _resolve_lookup Method
-------------------------------------+-------------------------------------
Reporter: Mohammad Salehi | Type: Bug
Status: new | Component: Template
| system
Version: 5.0 | Severity: Normal
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Hello,
While working on issue #35673, which deals with handling `request.GET`
when the number of query parameters exceeds the limit set in
`settings.DATA_UPLOAD_MAX_NUMBER_FIELDS`, I discovered another problem
with the _resolve_lookup method in the `Variable` class inside
`template/base.py`. When `request.GET` encounters an error, it causes
issues in the _resolve_lookup method. Specifically, when the code tries to
access GET and uses the `getattr` function, this function does not handle
errors properly, which leads to further problems in the system.
I believe there are two solutions: or the `getattr` function should be
modified to handle errors correctly, or the underlying cause of the error
in `getattr` should be addressed. It would be best to discuss this with
the other team members to determine the best approach and then implement
the necessary changes.
--
Ticket URL: <https://code.djangoproject.com/ticket/35720>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701919f9ed12c-e470437c-afc5-42db-9be6-0e16a0e0f2f2-000000%40eu-central-1.amazonses.com.