it seems that we have some redundant check here.
You already checked
<pre>
(options.database_filter == None)
</pre>
just 2 lines above.