2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-06 05:30:56 +00:00

Add function to generate "keys" for test results.

- As the keys are to be used for dict-based lookup (in a template) then they cannot contains spaces.
- May as well enforce lower-case encoding!
This commit is contained in:
Oliver Walters
2020-05-17 12:59:03 +10:00
parent c54cb2b280
commit 17f241774f
3 changed files with 18 additions and 2 deletions

View File

@ -962,7 +962,8 @@ class StockItem(MPTTModel):
result_map = {}
for result in results:
result_map[result.test] = result
key = helpers.generateTestKey(result.test)
result_map[key] = result
return result_map