<pre>
if device.deleted or (ignore_depreciation and is_depreciated(device)):
    return 0
return device.price or get_device_auto_price(device)
</pre>