Match the optional identifiers in every list's search box
gaugelabreference and maintenancereference are collected on the form and shown on the detail page for all five asset types, and no list's ?search= matched either. Someone holding a physical tag could read it off the machine, type it into the list they were already looking at, and get nothing back - while global search, fixed in the previous commit, found it. The clause is copy-pasted once per plugin, which is how all five came to omit fields their own forms collect, so the test is one parametrized pass over all five lists rather than five per-plugin tests that would drift the same way. It also pins that widening the clause did not turn the box into a pass-through. The api-inventory entries enumerate the fields each search matches, so all five were stale the moment the queries changed; updated with the OpenAPI spec. Not touched: the collector does not send either identifier, correctly - a lab-assigned tag is not something an agent on a PC can discover. The legacy import loader does not map them either, and the classic schema has no gauge-named column to map from.
This commit is contained in:
@@ -254,6 +254,11 @@ def list_printers():
|
||||
Asset.assetnumber.ilike(pattern),
|
||||
Asset.name.ilike(pattern),
|
||||
Asset.serialnumber.ilike(pattern),
|
||||
# The optional identifiers too (ADR-001). Global search matches
|
||||
# these, and a tag read off the machine has to find it here as
|
||||
# well - this box is where someone holding the label looks.
|
||||
Asset.gaugelabreference.ilike(pattern),
|
||||
Asset.maintenancereference.ilike(pattern),
|
||||
Printer.hostname.ilike(pattern),
|
||||
Printer.windowsname.ilike(pattern),
|
||||
PrinterType.printertype.ilike(pattern),
|
||||
|
||||
Reference in New Issue
Block a user