Skip to content

Apply djlint to Reformat all Django Templates#1166

Open
zandre-eng wants to merge 2 commits intomainfrom
ze/frontend-linting-reformat
Open

Apply djlint to Reformat all Django Templates#1166
zandre-eng wants to merge 2 commits intomainfrom
ze/frontend-linting-reformat

Conversation

@zandre-eng
Copy link
Copy Markdown
Contributor

@zandre-eng zandre-eng commented May 7, 2026

Product Description

No user-facing changes. This PR applies automated indentation reformatting to all 139 Django HTML templates and fixes a small number of pre-existing HTML issues, as a prerequisite for the frontend linting PR (CCCT-2388).

Technical Summary

CCCT-2388

Two commits:

  • chore: apply djlint reformat to all Django templates — pure whitespace/indentation normalisation generated by uvx djlint commcare_connect/templates/ --reformat --profile=django --indent=2. Safe to review with whitespace-hidden diffs (?w=1 on GitHub).
  • fix: lowercase form method and remove empty class attributes (H029, H026) — 7 targeted content fixes across 7 files: method="POST" lowercased to method="post" in 4 templates, empty class="" attributes removed in 3 templates. Both are inert changes (HTML form method is case-insensitive; empty class attributes have no effect).

This PR exists as a base for the hooks PR so that CI does not fail when djlint-reformat-django runs --all-files on an unformatted codebase.

Safety Assurance

Safety story

No Python, JavaScript, model, or view logic touched. Django renders templates identically regardless of indentation. Form method case is normalised by browsers and Django's request.method is always uppercased server-side. Empty class="" attributes match no CSS selectors or JavaScript. The change is fully reversible by reverting both commits.

Automated test coverage

No tests added or modified. Existing test suite covers template rendering behaviour and is unaffected by these changes.

QA Plan

QA will not be performed for this change. Below is the testing plan for reference:

  • Review the reformat commit with whitespace hidden (?w=1 on GitHub) to confirm no content changes
  • Review the fix commit normally to confirm only the 7 targeted attribute changes
  • Spot-check 2-3 pages in a local dev environment to confirm rendering is unchanged

Labels & Review

  • The set of people pinged as reviewers is appropriate for the level of risk of the change

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Warning

Rate limit exceeded

@zandre-eng has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 27 minutes and 12 seconds before requesting another review.

To continue reviewing without waiting, purchase usage credits in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 89d8b56a-1fe0-496f-bba8-2884f6cf220c

📥 Commits

Reviewing files that changed from the base of the PR and between 0245f06 and acef025.

📒 Files selected for processing (139)
  • commcare_connect/templates/403.html
  • commcare_connect/templates/404.html
  • commcare_connect/templates/500.html
  • commcare_connect/templates/account/account_inactive.html
  • commcare_connect/templates/account/base.html
  • commcare_connect/templates/account/email.html
  • commcare_connect/templates/account/email_confirm.html
  • commcare_connect/templates/account/login.html
  • commcare_connect/templates/account/logout.html
  • commcare_connect/templates/account/password_change.html
  • commcare_connect/templates/account/password_reset.html
  • commcare_connect/templates/account/password_reset_done.html
  • commcare_connect/templates/account/password_reset_from_key.html
  • commcare_connect/templates/account/password_reset_from_key_done.html
  • commcare_connect/templates/account/password_set.html
  • commcare_connect/templates/account/signup.html
  • commcare_connect/templates/account/signup_closed.html
  • commcare_connect/templates/account/verification_sent.html
  • commcare_connect/templates/account/verified_email_required.html
  • commcare_connect/templates/base.html
  • commcare_connect/templates/base_table.html
  • commcare_connect/templates/components/avatar.html
  • commcare_connect/templates/components/badges/badge_sm_dropdown.html
  • commcare_connect/templates/components/breadcrumbs.html
  • commcare_connect/templates/components/cards/user_status_card.html
  • commcare_connect/templates/components/confirm_modal.html
  • commcare_connect/templates/components/dropdowns/text_button_dropdown.html
  • commcare_connect/templates/components/filter_modal.html
  • commcare_connect/templates/components/form.html
  • commcare_connect/templates/components/invoice_confirm_modal.html
  • commcare_connect/templates/components/organization_home_page/add_org_member_modal.html
  • commcare_connect/templates/components/organization_home_page/remove_org_member_confirm_modal.html
  • commcare_connect/templates/components/partial_form.html
  • commcare_connect/templates/components/progressbar/simple-progressbar.html
  • commcare_connect/templates/components/sidenav-items.html
  • commcare_connect/templates/components/upload_progress_bar.html
  • commcare_connect/templates/components/worker_page/delete_invites_confirm_modal.html
  • commcare_connect/templates/components/worker_page/deliver_column.html
  • commcare_connect/templates/components/worker_page/export_modal.html
  • commcare_connect/templates/components/worker_page/fetch_flag_counts.html
  • commcare_connect/templates/components/worker_page/flag_counts.html
  • commcare_connect/templates/components/worker_page/import_modal.html
  • commcare_connect/templates/components/worker_page/last_paid.html
  • commcare_connect/templates/components/worker_page/payment_history.html
  • commcare_connect/templates/components/worker_page/profile.html
  • commcare_connect/templates/components/worker_page/visit_task_tabs.html
  • commcare_connect/templates/components/worker_page/worker_profile_kpi.html
  • commcare_connect/templates/email/base.html
  • commcare_connect/templates/favicon.html
  • commcare_connect/templates/flags/feature_flags.html
  • commcare_connect/templates/layouts/footer.html
  • commcare_connect/templates/layouts/header.html
  • commcare_connect/templates/layouts/sidenav.html
  • commcare_connect/templates/microplanning/cluster_work_area_final_status.html
  • commcare_connect/templates/microplanning/cluster_work_area_modal.html
  • commcare_connect/templates/microplanning/cluster_work_area_modal_status.html
  • commcare_connect/templates/microplanning/home.html
  • commcare_connect/templates/microplanning/import_work_area_modal.html
  • commcare_connect/templates/microplanning/map_handler.html
  • commcare_connect/templates/microplanning/work_area_form.html
  • commcare_connect/templates/opportunity/add_payment_units.html
  • commcare_connect/templates/opportunity/add_visits_existing_users.html
  • commcare_connect/templates/opportunity/assigned_task_edit_button.html
  • commcare_connect/templates/opportunity/assigned_task_list.html
  • commcare_connect/templates/opportunity/bulk_approval_reject_modal.html
  • commcare_connect/templates/opportunity/dashboard.html
  • commcare_connect/templates/opportunity/deliver.html
  • commcare_connect/templates/opportunity/edit_assigned_task_form.html
  • commcare_connect/templates/opportunity/edit_assigned_task_modal.html
  • commcare_connect/templates/opportunity/edit_task_type_form.html
  • commcare_connect/templates/opportunity/edit_task_type_modal.html
  • commcare_connect/templates/opportunity/email/automated_invoice_created.html
  • commcare_connect/templates/opportunity/email/invoice_paid.html
  • commcare_connect/templates/opportunity/extendable_payment_unit_row.html
  • commcare_connect/templates/opportunity/invoice_base.html
  • commcare_connect/templates/opportunity/invoice_create.html
  • commcare_connect/templates/opportunity/invoice_detail.html
  • commcare_connect/templates/opportunity/invoice_download.html
  • commcare_connect/templates/opportunity/invoice_list.html
  • commcare_connect/templates/opportunity/invoice_payment_report.html
  • commcare_connect/templates/opportunity/learn.html
  • commcare_connect/templates/opportunity/new_task_type_modal.html
  • commcare_connect/templates/opportunity/opportunities_list.html
  • commcare_connect/templates/opportunity/opportunity_delivery_stat.html
  • commcare_connect/templates/opportunity/opportunity_edit.html
  • commcare_connect/templates/opportunity/opportunity_finalize.html
  • commcare_connect/templates/opportunity/opportunity_funnel_progress.html
  • commcare_connect/templates/opportunity/opportunity_init.html
  • commcare_connect/templates/opportunity/opportunity_menu.html
  • commcare_connect/templates/opportunity/opportunity_resource_modal.html
  • commcare_connect/templates/opportunity/opportunity_worker.html
  • commcare_connect/templates/opportunity/opportunity_worker_learn.html
  • commcare_connect/templates/opportunity/opportunity_worker_progress.html
  • commcare_connect/templates/opportunity/partials/active_toggle_metadata.html
  • commcare_connect/templates/opportunity/partials/invoice_line_items.html
  • commcare_connect/templates/opportunity/partials/revoke_suspension.html
  • commcare_connect/templates/opportunity/payments.html
  • commcare_connect/templates/opportunity/send_message.html
  • commcare_connect/templates/opportunity/steps.html
  • commcare_connect/templates/opportunity/suspended_users.html
  • commcare_connect/templates/opportunity/task_types_config.html
  • commcare_connect/templates/opportunity/tasks.html
  • commcare_connect/templates/opportunity/user_task_details.html
  • commcare_connect/templates/opportunity/user_tasks.html
  • commcare_connect/templates/opportunity/user_visit_details.html
  • commcare_connect/templates/opportunity/user_visit_verification.html
  • commcare_connect/templates/opportunity/user_visit_verification_table.html
  • commcare_connect/templates/opportunity/verification_flags_config.html
  • commcare_connect/templates/opportunity/worker_list_base.html
  • commcare_connect/templates/opportunity/worker_list_work_areas.html
  • commcare_connect/templates/opportunity/worker_visit_table.html
  • commcare_connect/templates/opportunity/workers.html
  • commcare_connect/templates/organization/organization_create.html
  • commcare_connect/templates/organization/organization_home.html
  • commcare_connect/templates/pages/connect_user_otp.html
  • commcare_connect/templates/pages/home.html
  • commcare_connect/templates/program/email/monthly_delivery_reminder.html
  • commcare_connect/templates/program/email/opportunity_created.html
  • commcare_connect/templates/program/email/opportunity_expiry_reminder.html
  • commcare_connect/templates/program/email/program_invite_applied.html
  • commcare_connect/templates/program/email/program_invite_notification.html
  • commcare_connect/templates/program/nm_home.html
  • commcare_connect/templates/program/pm_home.html
  • commcare_connect/templates/program/program_base.html
  • commcare_connect/templates/program/program_form.html
  • commcare_connect/templates/reports/admin.html
  • commcare_connect/templates/reports/invoice_report.html
  • commcare_connect/templates/reports/report_table.html
  • commcare_connect/templates/tables/single_table.html
  • commcare_connect/templates/tables/table_manage_action.html
  • commcare_connect/templates/tables/table_placeholder.html
  • commcare_connect/templates/tasks/new_task_modal.html
  • commcare_connect/templates/users/accept_invite_confirm.html
  • commcare_connect/templates/users/demo_tokens.html
  • commcare_connect/templates/users/internal_features.html
  • commcare_connect/templates/users/permission_management.html
  • commcare_connect/templates/users/permission_management_results.html
  • commcare_connect/templates/users/user_detail.html
  • commcare_connect/templates/users/user_form.html
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ze/frontend-linting-reformat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@zandre-eng zandre-eng mentioned this pull request May 7, 2026
6 tasks
@zandre-eng zandre-eng force-pushed the ze/frontend-linting-reformat branch from 6b3ec61 to acef025 Compare May 7, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant