diff --git a/krill/reports/README.md b/krill/reports/README.md index bdffcee..31872f3 100644 --- a/krill/reports/README.md +++ b/krill/reports/README.md @@ -1,6 +1,6 @@ # Reports app -Reports is where you check that what Krill says is in storage is really there (the **storage audit**), and where alerts are listed. Open it from **Reports** in the sidebar. +Reports is where you check that what Krill says is in storage is really there (the **storage audit**), where alerts are listed, and where aliquots checked out with no recorded owner are listed. Open it from **Reports** in the sidebar. ## Storage audit @@ -38,6 +38,16 @@ Other people see the checklist with the fields disabled. Code: `reports/views.py` (`generate_audit_report`, `generate_storage_audit_data`, `audit_detail`, `audit_list`, `save_audit_result`, `delete_audit`), templates in `reports/templates/reports/`, tests in `reports/tests.py`. +## Checked out, no owner + +**Reports > Checked Out, No Owner** (`/reports/checked-out-no-owner/`) lists aliquots whose disposition is In Use but that have no recorded owner. Since Krill started recording who checks an aliquot out (the Check Out button saves the person and the time), every new checkout has an owner. The ones listed here were set to In Use before that, or by editing the aliquot by hand. + +A checked-out aliquot is used and discarded, so most of this list is aliquots that were used long ago and never marked Exhausted. Lab managers and admins can clear them from the page: tick the rows (the box in the header ticks everything on the page), pick a status, and press **Apply**. The status list is every status except Stored and In Use (Exhausted and Disposed), because a checked-out aliquot is never put back in storage. Each change is saved as an "Aliquot Updated" entry in the audit log, and only aliquots that are still In Use with no owner are changed, so a stale page cannot overwrite someone else's edit. Other people see the list without the tick boxes and can still open one aliquot at a time. The page shows the total and 50 aliquots per page, with sample, type, passage, sample date and last-updated date. + +A person's own checked-out aliquots are in the Aliquots list with the **Checked out by me** filter (`/samples/list/?type=aliquot&checked_out_by=me`). The owner and time stay on the aliquot after it is exhausted, as a record of who used it. + +Code: `checked_out_no_owner` in `reports/views.py` (handles the list and the status change), template `reports/templates/reports/checked_out_no_owner.html`, tests in `reports/test_checked_out_no_owner.py`. + ## Alerts **Reports > View Alerts** lists alerts with their severity (low, medium, high, critical), type (storage, sample, system, security, general) and status (active, acknowledged, resolved, dismissed). An active alert can be acknowledged and then resolved. The Reports page shows the count of active alerts and the latest five. diff --git a/krill/reports/templates/reports/checked_out_no_owner.html b/krill/reports/templates/reports/checked_out_no_owner.html new file mode 100644 index 0000000..5a265d1 --- /dev/null +++ b/krill/reports/templates/reports/checked_out_no_owner.html @@ -0,0 +1,109 @@ +{% extends 'base/layout.html' %} + +{% block title %}Checked Out, No Owner{% endblock %} + +{% block content %} +
+ {{ total }} aliquot{{ total|pluralize }} marked In Use with no recorded owner. Most were checked out + before Krill recorded who, or had their status set to In Use by hand. A checked-out aliquot is used + and discarded, so these are mostly aliquots that were used long ago and never marked Exhausted. Open one + to mark it Exhausted. +
+ {% for message in messages %} + + {% endfor %} +No aliquots are checked out without an owner.
+ {% endif %} +