﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36692	TemplateSyntaxError in clearable_file_input.html due to unbalanced template logic	Kiran	Kiran	"Problem
-------
Running the admin_widgets tests locally raised a TemplateSyntaxError from:
  django/contrib/admin/templates/admin/widgets/clearable_file_input.html

The template had mismatched conditional block logic (an `{% else %}` / `{% endif %}` placement issue), which caused the Django template parser to fail when rendering AdminFileWidget in tests.

Reproduction
----------
Run locally:
    python tests/runtests.py admin_widgets -v 2

Observed a TemplateSyntaxError during template parsing in clearable_file_input.html.

Fix
---
Adjusted the conditional structure in clearable_file_input.html to properly balance `{% if %}` / `{% else %}` / `{% endif %}` blocks. This allows the AdminFileWidget to render as expected.

Verification
----------
I ran:
    python tests/runtests.py admin_widgets -v 2
All admin_widgets tests passed successfully after the fix.

Patch / PR
----------
PR: https://github.com/keranbyge/django/pull/20008
"	Bug	closed	contrib.admin	5.2	Normal	worksforme	admin_widgets, template, AdminFileWidget, TemplateSyntaxError		Unreviewed	1	0	0	0	0	0
