# FT Panel 26.8.4

Released 18 August 2026, the same day as 26.8.3. Everything here was found by
using the panel rather than by testing it, which is worth noting: three of these
were faults 26.8.3 introduced or exposed.

## Alerts to administrators

**Irreversible actions now raise an alert.** `send_admin_alert()` in
`apps/ftlink/alerts.py` reaches every active system administrator by email, SMS
and WhatsApp, each channel failing independently. It never raises, because an
alert that fails must not roll back the action it is reporting.

Wired to two places:

- **Tenant deleted.** Domain, plan, creation date and who pressed it are read
  before the row goes, since none of it can be looked up afterwards, and the
  alert is sent after the delete succeeds.
- **Backup deleted.** On purge, not on delete. Delete only moves the file to
  `_trash_`, which the 15 second undo cancels. Purge is when it leaves the disk,
  and it only alerts if a file was really there.

## Incident emails split in two

`incident_alert.html` handled down and recovered in one file with a colour
switch. It is now two templates, so editing one cannot disturb the other:

- `incident_down.html`, red, with cause, status code, failed check count and an
  orange "check this first" box carrying the suggested fix.
- `incident_recovered.html`, green, with how long it was down and a note that a
  site which recovers on its own can still be worth looking at.

Both are listed on the Homepage screen with previews at
`/products/email-preview/incident-down/` and `/incident-recovered/`.

## Service Health, three counting faults

**"3 sites down" on an estate of four.** The count included sites with
monitoring switched off. Those keep their last failed sample forever, since
nothing probes them again, so they reported a permanent outage on domains that
were never live. Only monitored sites count now, and the open incident total in
the header follows the same rule.

**Everything showing green.** The incident dot knew two states, ended or
ongoing. Switching a site off closed its incidents, so they went green, which
reads as "recovered" when the truth is "we stopped watching". There is now a
third state, grey and "not monitored". Green means it genuinely came back.

**Unreadable durations.** `{{ i.duration }}` rendered a raw timedelta, so an
incident read `1 day, 21:54:41.865252`. New `short_duration` filter gives
`1d 21h`, `3h 40m`, `45m`, matching `short_ago` used elsewhere.

## Deleting a tenant

- The delete button is off the tenants list. Deletion starts on the tenant's own
  page.
- The confirmation page no longer deletes. It returns to the list with the
  tenant pending, where the row disappears and a red bar counts down from
  fifteen with an Undo button. The deletion is only posted when it reaches zero.
- The green success banner is suppressed on that route. The red bar already said
  it, and a cheerier second message afterwards reads as a different event.
- The confirmation page carries the tenant edit page's style block in full, with
  actions in the sidebar under the tenant card, matching Save and Cancel there.

Worth being clear: the fifteen seconds is a grace period in the browser, not a
recycle bin. Once it fires the tenant is gone and the alert email is the record.
Backups differ because the file is moved to trash first.

## One delete button

`.btn-cms-danger` in `base.html` is now the only delete style: outlined red at
rest, filled red on hover, in true red `#e0201b` rather than the brick
`#d9534f`, and boxed exactly like `.btn-cms` and `.btn-cms-ghost` so Delete and
Cancel are identical side by side. **40 delete controls across 31 templates**
were swept onto it, dropping the inline colours they each carried. Three
different looks were in circulation before, depending on the page.

Small icon-only deletes inside table rows keep their compact padding, because
they sit beside Edit buttons of that scale.

## Crashes fixed

**Invoice page 500.** `{{ x|default:y }}` evaluates its argument even when it is
not used, so `invoice.tenant.owner.email` raised on a tenant with no owner and
took the page down. A missing variable is silenced in ordinary output but not as
a filter argument.

Swept the project for the same trap: **18 further cases** across 14 templates,
all walking through a nullable foreign key, `author`, `added_by`, `created_by`,
`changed_by`, `sent_by`. Any row with that field empty would have failed the
same way. All converted to `{% firstof %}`, which resolves with failures
ignored.

**Email preview 500.** A helper inserted between the decorators and the view
left `@login_required` attached to the helper, so `email_preview` ran
undecorated and the helper raised when called. Reachable without signing in for
a few minutes; it renders sample data only, so nothing leaked.

## Smaller things

- Tenant list actions return to the row you clicked, on the page and filter you
  were on, rather than the top of page one. Same pattern as Health.
- Send Invoice moved onto `btn-cms`; the one-off `btn-cms-outline` in that
  template is gone. It is disabled with an explanation when the client has no
  billing address.
- Swept every template for multiline `{# #}` comments, which render as visible
  text. Three found, including two I had just written. Now zero project wide.

## Files

No migrations. Templates, `apps/accounts/cms_views.py`, `apps/ftlink/alerts.py`,
`apps/ecommerce/views.py`, `apps/accounts/templatetags/cms_time.py`,
`config/settings/base.py`.

## Still open

Mac and server code drift, still not reconciled, and roughly thirty files went
up today on trust. Plain SQL dumps and a Google service account key in `/root`.
Stripe live secret and SMTP password to rotate. Legacy `AuctionListing` rows to
merge.
