Skip to content

refactor(templates): migrate user.is_staff to user.is_staff_user (#176)#180

Open
b3lz3but wants to merge 1 commit intocaptainpragmatic:masterfrom
b3lz3but:refactor/template-is-staff-user-migration
Open

refactor(templates): migrate user.is_staff to user.is_staff_user (#176)#180
b3lz3but wants to merge 1 commit intocaptainpragmatic:masterfrom
b3lz3but:refactor/template-is-staff-user-migration

Conversation

@b3lz3but
Copy link
Copy Markdown
Contributor

@b3lz3but b3lz3but commented Apr 16, 2026

Summary

Migrates ~24 instances of user.is_staff and user.is_staff or user.staff_role to user.is_staff_user across 8 non-ticket template files.

  • dashboard.html (15 instances) — highest-traffic page, staff-by-role users now see the correct staff UI
  • billing_list.html, billing_list_component.html (4 total) — customer column and header controls
  • proforma_detail.html — internal notes guard
  • base.html — compound user.is_staff or user.staff_role simplified to user.is_staff_user
  • mobile_header.html — same compound pattern
  • header_action.htmlrequest.user.is_staff or request.user.staff_role simplified
  • users/profile.html — staff badge display

Not included

Ticket templates (detail.html, list.html, comments_list.html, status_and_comments.html, tickets_table.html) are covered by PR #159 and excluded to avoid merge conflicts.

Test plan

  • All pre-commit hooks pass (template lint, i18n, security checks)
  • Changes are template-only — no Python logic affected

Addresses #176

🤖 Generated with Claude Code

Closes #176

…on-ticket templates (captainpragmatic#176)

- dashboard.html: 15 instances migrated (highest-traffic page)
- billing_list.html, billing_list_component.html: 4 instances total
- proforma_detail.html: internal notes guard
- base.html: compound user.is_staff or user.staff_role pattern replaced
- mobile_header.html: same compound pattern
- header_action.html: request.user compound pattern
- users/profile.html: 1 instance

Ticket templates (detail, list, comments_list, status_and_comments,
tickets_table) are excluded — they are covered by PR captainpragmatic#159.

Addresses captainpragmatic#176.

Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
@b3lz3but
Copy link
Copy Markdown
Contributor Author

@mostlyvirtual CI green — 24 template instances across dashboard, billing, base, components, and customer templates migrated to is_staff_user. Ticket templates excluded (covered by PR #159). Ready for review 🙏

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.

refactor(templates): migrate remaining ~25 user.is_staff checks to user.is_staff_user in templates

1 participant