Small device lendings
I assume at some point someone asked "Can we use the lending system for small devices that we don't want to register as actual Lagerregal devices?" and the most simple solution was picked at the time. It works decently enough.
However, it's not exactly elegant.
The lending model now no longer has a (1,1)-(1,1) relationship with a device, it is now (0,1) instead on the lending->device side. A lot of lending code has to check for "does it have a device? If not, does it have a smalldevice?" - I've already had to make some fixes regarding this in spots where it was missed.
Also, the standard lending view can only be accessed through the url pattern devices/device:pk/lending:pk/
, which makes it impossible to view small device lendings (I think).
The history view is broken for this reason: !32 (closed) Some of it I was able to fix, but some of it I was only able to "hotfix" to where it no longer returns errors but also doesn't work properly.
At some point, I think we should redesign this system. I don't have an immediate obvious answer.