#33830: Variable lookup errors are logged rendering 'clearable_file_input.html'
---------------------------------+------------------------------------
Reporter: Horst Schneider | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: admin, template | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Comment (by Neeraj Kumar):
Replying to [comment:6 Horst Schneider]:
> Replying to [comment:5 Carlton Gibson]:
> > @Horst could you investigate setting a default (`False`) for disabled
in ClearableFileInput for this case?
>
> Setting it both to `True` or `False` explicitly in the `attrs` does not
trigger the `VariableDoesNotExist` exception to be logged. Only the
absence of the `disabled` attribute on the `attrs` altogether triggers it.
This error already handled in Exception when we do not provide "disabled"
in attrs.
{{{
raise VariableDoesNotExist("Failed lookup for key "
"[%s] in %r",
(bit, current)) # missing attribute
}}}
{{{
except Exception as e:
template_name = getattr(context, 'template_name', None) or
'unknown'
logger.debug(
"Exception while resolving variable '%s' in template
'%s'.",
bit,
template_name,
exc_info=True,
)
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33830#comment:8>
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/01070182cc268d93-fed1c3ce-2bf5-4870-9022-224397d3ab1c-000000%40eu-central-1.amazonses.com.